@arbidocs/blocks 0.4.144 → 0.4.145
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 +267 -267
- package/dist/agents/index.js +10 -10
- package/dist/chat/index.cjs +1 -1
- package/dist/chat/index.js +1 -1
- package/dist/{chunk-BUWBXJ2N.cjs → chunk-34GDGE77.cjs} +5 -5
- package/dist/{chunk-BUWBXJ2N.cjs.map → chunk-34GDGE77.cjs.map} +1 -1
- package/dist/{chunk-ON3TKY5Y.js → chunk-5YHEHEJT.js} +242 -4
- package/dist/chunk-5YHEHEJT.js.map +1 -0
- package/dist/{chunk-YFY3TQ6Q.cjs → chunk-COCGRJLA.cjs} +7 -7
- package/dist/{chunk-YFY3TQ6Q.cjs.map → chunk-COCGRJLA.cjs.map} +1 -1
- package/dist/{chunk-45LRMW54.js → chunk-DN2KI4BU.js} +8 -10
- package/dist/chunk-DN2KI4BU.js.map +1 -0
- package/dist/{chunk-R26BK7YL.cjs → chunk-DTROMMDX.cjs} +4 -4
- package/dist/{chunk-R26BK7YL.cjs.map → chunk-DTROMMDX.cjs.map} +1 -1
- package/dist/{chunk-65THHQVB.cjs → chunk-ECW2R2KF.cjs} +27 -27
- package/dist/{chunk-65THHQVB.cjs.map → chunk-ECW2R2KF.cjs.map} +1 -1
- package/dist/{chunk-RI6DZA5X.js → chunk-EF4ZLKRM.js} +3 -3
- package/dist/{chunk-RI6DZA5X.js.map → chunk-EF4ZLKRM.js.map} +1 -1
- package/dist/{chunk-WS5EX7DN.cjs → chunk-EYKISBDO.cjs} +5 -5
- package/dist/{chunk-WS5EX7DN.cjs.map → chunk-EYKISBDO.cjs.map} +1 -1
- package/dist/{chunk-JZNXRMLH.cjs → chunk-GAYMJWTC.cjs} +8 -10
- package/dist/chunk-GAYMJWTC.cjs.map +1 -0
- package/dist/{chunk-I7WG3JRD.js → chunk-H4D7WKDY.js} +3 -3
- package/dist/{chunk-I7WG3JRD.js.map → chunk-H4D7WKDY.js.map} +1 -1
- package/dist/{chunk-3RJN2VTL.js → chunk-IXWJGOM2.js} +3 -3
- package/dist/{chunk-3RJN2VTL.js.map → chunk-IXWJGOM2.js.map} +1 -1
- package/dist/{chunk-7NGAWGA3.js → chunk-J4M37SXY.js} +3 -3
- package/dist/{chunk-7NGAWGA3.js.map → chunk-J4M37SXY.js.map} +1 -1
- package/dist/{chunk-CYNF5PZI.js → chunk-J5CWKFSC.js} +3 -3
- package/dist/{chunk-CYNF5PZI.js.map → chunk-J5CWKFSC.js.map} +1 -1
- package/dist/{chunk-TP6PLDNM.cjs → chunk-KMZWKSKO.cjs} +8 -8
- package/dist/{chunk-TP6PLDNM.cjs.map → chunk-KMZWKSKO.cjs.map} +1 -1
- package/dist/{chunk-XGZX22ET.cjs → chunk-KPO67GBR.cjs} +39 -39
- package/dist/{chunk-XGZX22ET.cjs.map → chunk-KPO67GBR.cjs.map} +1 -1
- package/dist/{chunk-C4WSHRR6.cjs → chunk-KPZZ5FHE.cjs} +32 -12
- package/dist/chunk-KPZZ5FHE.cjs.map +1 -0
- package/dist/{chunk-X3TGXEFS.js → chunk-KTSF4HFC.js} +7 -7
- package/dist/{chunk-X3TGXEFS.js.map → chunk-KTSF4HFC.js.map} +1 -1
- package/dist/{chunk-33ZOUJXA.js → chunk-NGDXDHLG.js} +13 -32
- package/dist/chunk-NGDXDHLG.js.map +1 -0
- package/dist/chunk-NHZK64TQ.js +75 -0
- package/dist/chunk-NHZK64TQ.js.map +1 -0
- package/dist/{chunk-BPBSSMRB.js → chunk-NRFAWUVD.js} +3 -3
- package/dist/{chunk-BPBSSMRB.js.map → chunk-NRFAWUVD.js.map} +1 -1
- package/dist/{chunk-O2ODDTMA.cjs → chunk-NSNHRZBH.cjs} +8 -8
- package/dist/{chunk-O2ODDTMA.cjs.map → chunk-NSNHRZBH.cjs.map} +1 -1
- package/dist/chunk-NWNVWO6L.cjs +80 -0
- package/dist/chunk-NWNVWO6L.cjs.map +1 -0
- package/dist/{chunk-Y3KA6X7B.js → chunk-OVR3XMYL.js} +4 -4
- package/dist/{chunk-Y3KA6X7B.js.map → chunk-OVR3XMYL.js.map} +1 -1
- package/dist/{chunk-2FJMTZNJ.js → chunk-QOL3M4FJ.js} +9 -9
- package/dist/{chunk-2FJMTZNJ.js.map → chunk-QOL3M4FJ.js.map} +1 -1
- package/dist/{chunk-LYUO3E6V.js → chunk-SZOFGU7W.js} +3 -3
- package/dist/{chunk-LYUO3E6V.js.map → chunk-SZOFGU7W.js.map} +1 -1
- package/dist/{chunk-YNIBUKV5.js → chunk-TBEVGWY3.js} +32 -14
- package/dist/chunk-TBEVGWY3.js.map +1 -0
- package/dist/{chunk-MJCCBMM5.cjs → chunk-TC3RQNEX.cjs} +6 -80
- package/dist/chunk-TC3RQNEX.cjs.map +1 -0
- package/dist/{chunk-QIMVTGKS.cjs → chunk-U73KPFYH.cjs} +255 -2
- package/dist/chunk-U73KPFYH.cjs.map +1 -0
- package/dist/{chunk-RA3ZJ45L.cjs → chunk-ULPFRK3J.cjs} +25 -44
- package/dist/chunk-ULPFRK3J.cjs.map +1 -0
- package/dist/{chunk-HFGXA5CL.cjs → chunk-UTTTJSQU.cjs} +4 -4
- package/dist/{chunk-HFGXA5CL.cjs.map → chunk-UTTTJSQU.cjs.map} +1 -1
- package/dist/{chunk-DLBUFHLY.js → chunk-VTTZZ4FN.js} +4 -74
- package/dist/chunk-VTTZZ4FN.js.map +1 -0
- package/dist/{chunk-A6J2IBUG.js → chunk-VVZ34A2P.js} +3 -3
- package/dist/{chunk-A6J2IBUG.js.map → chunk-VVZ34A2P.js.map} +1 -1
- package/dist/{chunk-ABUO6PIQ.cjs → chunk-WO7QAVTL.cjs} +13 -13
- package/dist/{chunk-ABUO6PIQ.cjs.map → chunk-WO7QAVTL.cjs.map} +1 -1
- package/dist/{chunk-5FTIHRZH.cjs → chunk-XVUOMWMD.cjs} +4 -4
- package/dist/{chunk-5FTIHRZH.cjs.map → chunk-XVUOMWMD.cjs.map} +1 -1
- package/dist/{chunk-444XKG46.js → chunk-YKQ2DPIP.js} +3 -3
- package/dist/{chunk-444XKG46.js.map → chunk-YKQ2DPIP.js.map} +1 -1
- package/dist/{chunk-HEMU73OP.cjs → chunk-YSHIC4NJ.cjs} +4 -4
- package/dist/{chunk-HEMU73OP.cjs.map → chunk-YSHIC4NJ.cjs.map} +1 -1
- package/dist/citations/index.cjs +12 -12
- package/dist/citations/index.js +3 -3
- package/dist/collaboration/index.cjs +9 -9
- package/dist/collaboration/index.js +1 -1
- package/dist/connect/docx.cjs +11 -11
- package/dist/connect/docx.js +8 -8
- package/dist/connect/index.cjs +716 -329
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +1 -0
- package/dist/connect/index.js +591 -217
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectedSettings.d.ts +3 -2
- package/dist/connection/ai.d.ts +27 -72
- package/dist/connection/settings-page/ConnectedAccountSettings.d.ts +35 -0
- package/dist/connection/settings-page/ConnectedMailSettings.d.ts +13 -0
- package/dist/connection/settings-page/ConnectedPremiumModels.d.ts +1 -0
- package/dist/connection/settings-page/ConnectedPrivacySettings.d.ts +12 -0
- package/dist/connection/settings-page/ConnectedSettingsPage.d.ts +29 -0
- package/dist/connection/settings-page/SessionStatusIcon.d.ts +7 -0
- package/dist/connection/settings-page/index.d.ts +6 -0
- package/dist/connection/workspaceData.d.ts +6 -6
- package/dist/document-tools/index.cjs +1 -1
- package/dist/document-tools/index.js +1 -1
- package/dist/facts/index.cjs +4 -4
- package/dist/facts/index.js +3 -3
- package/dist/files/index.cjs +3 -3
- package/dist/files/index.js +2 -2
- package/dist/home/index.cjs +20 -20
- package/dist/home/index.js +4 -4
- package/dist/index.cjs +476 -467
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -22
- package/dist/index.js.map +1 -1
- package/dist/provider/BlocksProvider.d.ts +5 -1
- package/dist/provider/settings-section.d.ts +9 -0
- package/dist/retrieval/index.cjs +4 -4
- package/dist/retrieval/index.js +2 -2
- package/dist/settings/AppearanceSettings.d.ts +18 -0
- package/dist/settings/ServerConnectionControls.d.ts +16 -0
- package/dist/settings/SettingsPage.d.ts +31 -0
- package/dist/settings/index.cjs +187 -250
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.d.ts +3 -1
- package/dist/settings/index.js +87 -199
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/index.cjs +44 -44
- package/dist/shell/index.js +3 -3
- package/dist/site/index.cjs +75 -74
- package/dist/site/index.js +4 -3
- package/dist/studio/index.cjs +80 -79
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +12 -11
- package/dist/studio/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +28 -28
- package/dist/workflow-canvas/index.js +11 -11
- package/dist/workspaces/index.cjs +3 -3
- package/dist/workspaces/index.js +2 -2
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +4 -4
- package/dist/chunk-33ZOUJXA.js.map +0 -1
- package/dist/chunk-45LRMW54.js.map +0 -1
- package/dist/chunk-C4WSHRR6.cjs.map +0 -1
- package/dist/chunk-DLBUFHLY.js.map +0 -1
- package/dist/chunk-JZNXRMLH.cjs.map +0 -1
- package/dist/chunk-MJCCBMM5.cjs.map +0 -1
- package/dist/chunk-ON3TKY5Y.js.map +0 -1
- package/dist/chunk-QIMVTGKS.cjs.map +0 -1
- package/dist/chunk-RA3ZJ45L.cjs.map +0 -1
- package/dist/chunk-YNIBUKV5.js.map +0 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkGAYMJWTC_cjs = require('../chunk-GAYMJWTC.cjs');
|
|
5
5
|
var chunkGFNELPDP_cjs = require('../chunk-GFNELPDP.cjs');
|
|
6
|
-
var
|
|
7
|
-
|
|
6
|
+
var chunkKPO67GBR_cjs = require('../chunk-KPO67GBR.cjs');
|
|
7
|
+
require('../chunk-3AFWGEDJ.cjs');
|
|
8
|
+
require('../chunk-DVUZTGVL.cjs');
|
|
9
|
+
var chunkWO7QAVTL_cjs = require('../chunk-WO7QAVTL.cjs');
|
|
10
|
+
require('../chunk-DETZZBG2.cjs');
|
|
8
11
|
require('../chunk-RFIBUWLF.cjs');
|
|
9
|
-
var
|
|
10
|
-
require('../chunk-WS5EX7DN.cjs');
|
|
12
|
+
var chunkNSNHRZBH_cjs = require('../chunk-NSNHRZBH.cjs');
|
|
11
13
|
require('../chunk-RQ2Y7USX.cjs');
|
|
12
14
|
require('../chunk-AHDJXIUB.cjs');
|
|
13
15
|
require('../chunk-ZW6FPIFC.cjs');
|
|
14
|
-
require('../chunk-3AFWGEDJ.cjs');
|
|
15
|
-
require('../chunk-DVUZTGVL.cjs');
|
|
16
|
-
require('../chunk-DETZZBG2.cjs');
|
|
17
|
-
require('../chunk-R26BK7YL.cjs');
|
|
18
16
|
require('../chunk-V4ISCZJ7.cjs');
|
|
19
17
|
require('../chunk-2EI7NCUA.cjs');
|
|
20
18
|
require('../chunk-C2CWWEHO.cjs');
|
|
19
|
+
require('../chunk-EYKISBDO.cjs');
|
|
20
|
+
require('../chunk-DTROMMDX.cjs');
|
|
21
21
|
require('../chunk-7RGLTF76.cjs');
|
|
22
22
|
var chunkJSTKEZBS_cjs = require('../chunk-JSTKEZBS.cjs');
|
|
23
23
|
var chunk76L6LOP3_cjs = require('../chunk-76L6LOP3.cjs');
|
|
24
|
-
require('../chunk-7UTB4PHM.cjs');
|
|
25
24
|
var chunk32HW2Q33_cjs = require('../chunk-32HW2Q33.cjs');
|
|
25
|
+
require('../chunk-7UTB4PHM.cjs');
|
|
26
26
|
require('../chunk-FX3K6LNZ.cjs');
|
|
27
27
|
require('../chunk-PPCATBOY.cjs');
|
|
28
28
|
require('../chunk-MHVNT4J3.cjs');
|
|
29
|
-
var
|
|
29
|
+
var chunkKPZZ5FHE_cjs = require('../chunk-KPZZ5FHE.cjs');
|
|
30
30
|
require('../chunk-ULWRNGGE.cjs');
|
|
31
31
|
require('../chunk-KDG6FER6.cjs');
|
|
32
32
|
require('../chunk-DES3K4SD.cjs');
|
|
@@ -320,9 +320,9 @@ function SignalsEditor({
|
|
|
320
320
|
{
|
|
321
321
|
className: ui.cn(
|
|
322
322
|
"space-y-1.5 rounded-md border p-2",
|
|
323
|
-
|
|
323
|
+
chunkWO7QAVTL_cjs.isIncompleteSignal(signal) ? "border-destructive/50" : "border-border"
|
|
324
324
|
),
|
|
325
|
-
"data-incomplete":
|
|
325
|
+
"data-incomplete": chunkWO7QAVTL_cjs.isIncompleteSignal(signal) || void 0,
|
|
326
326
|
"data-testid": `${testId}-${i}`,
|
|
327
327
|
children: [
|
|
328
328
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
@@ -1608,7 +1608,7 @@ function triggerFields(trigger, clearOthers) {
|
|
|
1608
1608
|
return {
|
|
1609
1609
|
timezone: trigger.timezone,
|
|
1610
1610
|
rrule: trigger.start === "repeat" ? trigger.rrule.trim() : none,
|
|
1611
|
-
run_at: trigger.start === "once" ?
|
|
1611
|
+
run_at: trigger.start === "once" ? chunkKPO67GBR_cjs.localInputToIso(trigger.runAt) : none,
|
|
1612
1612
|
event_kind: trigger.start === "event" ? trigger.eventKind.trim() : none,
|
|
1613
1613
|
// A step signal is `workflow_signal` narrowed to one signal name.
|
|
1614
1614
|
event_filter: filter ?? none,
|
|
@@ -1624,7 +1624,7 @@ function plan(value, options) {
|
|
|
1624
1624
|
criteria: [],
|
|
1625
1625
|
max_passes: 3,
|
|
1626
1626
|
documents: [],
|
|
1627
|
-
steps:
|
|
1627
|
+
steps: chunkWO7QAVTL_cjs.toPlanSteps(value.workflow, options)
|
|
1628
1628
|
};
|
|
1629
1629
|
}
|
|
1630
1630
|
function builderToWorkflowRequest(value, workspaceId, options = {}) {
|
|
@@ -1659,7 +1659,7 @@ function builderToWorkflowUpdate(value, options = {}) {
|
|
|
1659
1659
|
}
|
|
1660
1660
|
function workflowRecordToBuilder(record) {
|
|
1661
1661
|
const planned = record.plan?.steps ?? [];
|
|
1662
|
-
const steps = planned.length ?
|
|
1662
|
+
const steps = planned.length ? chunkWO7QAVTL_cjs.fromPlanSteps(planned) : record.prompt || record.skill_ref ? [
|
|
1663
1663
|
{
|
|
1664
1664
|
id: "work",
|
|
1665
1665
|
kind: "agent",
|
|
@@ -1667,7 +1667,7 @@ function workflowRecordToBuilder(record) {
|
|
|
1667
1667
|
...record.skill_ref ? { workflow: record.skill_ref } : { run: { kind: "prompt", promptTemplate: record.prompt } }
|
|
1668
1668
|
}
|
|
1669
1669
|
] : [];
|
|
1670
|
-
const when =
|
|
1670
|
+
const when = chunkKPO67GBR_cjs.workflowWhen(record);
|
|
1671
1671
|
return {
|
|
1672
1672
|
workflow: {
|
|
1673
1673
|
id: record.external_id,
|
|
@@ -1676,12 +1676,12 @@ function workflowRecordToBuilder(record) {
|
|
|
1676
1676
|
inputs: [],
|
|
1677
1677
|
landing: "chat",
|
|
1678
1678
|
schedulable: false,
|
|
1679
|
-
run: { kind: "steps", steps, layout:
|
|
1679
|
+
run: { kind: "steps", steps, layout: chunkWO7QAVTL_cjs.layoutFromPlanSteps(planned ?? []) }
|
|
1680
1680
|
},
|
|
1681
1681
|
trigger: {
|
|
1682
1682
|
...DEFAULT_WORKFLOW_TRIGGER,
|
|
1683
1683
|
start: when === "now" ? "manual" : when,
|
|
1684
|
-
runAt:
|
|
1684
|
+
runAt: chunkKPO67GBR_cjs.isoToLocalInput(record.run_at),
|
|
1685
1685
|
rrule: record.rrule ?? "",
|
|
1686
1686
|
timezone: record.timezone || DEFAULT_WORKFLOW_TRIGGER.timezone,
|
|
1687
1687
|
eventKind: record.event_kind ?? "",
|
|
@@ -1737,7 +1737,7 @@ function triggerSummary(trigger, options = {}) {
|
|
|
1737
1737
|
case "once":
|
|
1738
1738
|
return trigger.runAt ? new Date(trigger.runAt).toLocaleString() : l.starts.once;
|
|
1739
1739
|
case "repeat":
|
|
1740
|
-
return trigger.rrule ?
|
|
1740
|
+
return trigger.rrule ? chunkKPO67GBR_cjs.describeRRule(trigger.rrule) : l.starts.repeat;
|
|
1741
1741
|
case "event":
|
|
1742
1742
|
if (isSignalTrigger(trigger))
|
|
1743
1743
|
return trigger.signal ? l.signalSummary.replace("{signal}", trigger.signal) : l.stepSignals;
|
|
@@ -1796,7 +1796,7 @@ function TriggerInspector({
|
|
|
1796
1796
|
}
|
|
1797
1797
|
)
|
|
1798
1798
|
] }),
|
|
1799
|
-
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1799
|
+
trigger.start === "repeat" && /* @__PURE__ */ jsxRuntime.jsx(chunkKPO67GBR_cjs.RecurrenceBuilder, { rrule: trigger.rrule, onChange: (rrule) => set({ rrule }) }),
|
|
1800
1800
|
trigger.start === "event" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1801
1801
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.event }),
|
|
1802
1802
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1848,7 +1848,7 @@ function TriggerInspector({
|
|
|
1848
1848
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5", children: [
|
|
1849
1849
|
/* @__PURE__ */ jsxRuntime.jsx(ui.Label, { className: "text-xs", children: l.agent }),
|
|
1850
1850
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1851
|
-
|
|
1851
|
+
chunkNSNHRZBH_cjs.AgentSelect,
|
|
1852
1852
|
{
|
|
1853
1853
|
agents,
|
|
1854
1854
|
value: trigger.agentId,
|
|
@@ -2685,13 +2685,13 @@ function WorkflowPreview({
|
|
|
2685
2685
|
renderIcon,
|
|
2686
2686
|
testId
|
|
2687
2687
|
}) {
|
|
2688
|
-
const run =
|
|
2688
|
+
const run = chunkKPO67GBR_cjs.useWorkflowPreview(workflow, {
|
|
2689
2689
|
resolveWorkflow: (id) => workflows.find((w) => w.id === id),
|
|
2690
2690
|
compose,
|
|
2691
2691
|
answer
|
|
2692
2692
|
});
|
|
2693
2693
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2694
|
-
|
|
2694
|
+
chunkWO7QAVTL_cjs.WorkflowRunner,
|
|
2695
2695
|
{
|
|
2696
2696
|
workflow,
|
|
2697
2697
|
run,
|
|
@@ -2767,14 +2767,14 @@ function ConnectedWorkflowBuilder({
|
|
|
2767
2767
|
...builderProps
|
|
2768
2768
|
}) {
|
|
2769
2769
|
const l = { ...DEFAULT_CONNECTED_WORKFLOW_BUILDER_LABELS, ...connectedLabels };
|
|
2770
|
-
const { notify, openConversation } =
|
|
2770
|
+
const { notify, openConversation } = chunkKPZZ5FHE_cjs.useBlocksEnvironment();
|
|
2771
2771
|
const { workspaceId, live, ensureWorkspaceOpen } = chunkGFNELPDP_cjs.useConnectedWorkspace();
|
|
2772
2772
|
const members = react$2.useWorkspaceUsers(workspaceId ?? void 0, {
|
|
2773
2773
|
enabled: live && !!workspaceId,
|
|
2774
2774
|
beforeFetch: ensureWorkspaceOpen
|
|
2775
2775
|
});
|
|
2776
|
-
const { data: tagList } =
|
|
2777
|
-
const { data: docList } =
|
|
2776
|
+
const { data: tagList } = chunkGAYMJWTC_cjs.useConnectedTags();
|
|
2777
|
+
const { data: docList } = chunkGAYMJWTC_cjs.useConnectedDocuments();
|
|
2778
2778
|
const people = (members.data ?? []).map((m) => ({
|
|
2779
2779
|
value: m.user.external_id,
|
|
2780
2780
|
label: [m.user.given_name, m.user.family_name].filter(Boolean).join(" ") || m.user.email
|
|
@@ -2787,7 +2787,7 @@ function ConnectedWorkflowBuilder({
|
|
|
2787
2787
|
const saved = react$2.useWorkflows();
|
|
2788
2788
|
const skills = react$2.useSkills();
|
|
2789
2789
|
const agentsQuery = react$2.useAgents();
|
|
2790
|
-
const { data: conversations } =
|
|
2790
|
+
const { data: conversations } = chunkGAYMJWTC_cjs.useConnectedConversations();
|
|
2791
2791
|
const create = react$2.useCreateWorkflow();
|
|
2792
2792
|
const update = react$2.useUpdateWorkflow();
|
|
2793
2793
|
const run = react$2.useRunWorkflow();
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { useConnectedTags, useConnectedDocuments, useConnectedConversations } from '../chunk-
|
|
2
|
+
import { useConnectedTags, useConnectedDocuments, useConnectedConversations } from '../chunk-DN2KI4BU.js';
|
|
3
3
|
import { useConnectedWorkspace } from '../chunk-US3S4DCB.js';
|
|
4
|
-
import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, useWorkflowPreview, localInputToIso } from '../chunk-
|
|
5
|
-
import
|
|
4
|
+
import { workflowWhen, isoToLocalInput, describeRRule, RecurrenceBuilder, useWorkflowPreview, localInputToIso } from '../chunk-QOL3M4FJ.js';
|
|
5
|
+
import '../chunk-RFXJYIDV.js';
|
|
6
|
+
import '../chunk-5LXQPP2K.js';
|
|
7
|
+
import { isIncompleteSignal, fromPlanSteps, layoutFromPlanSteps, WorkflowRunner, toPlanSteps } from '../chunk-KTSF4HFC.js';
|
|
8
|
+
import '../chunk-EVUEIBNU.js';
|
|
6
9
|
import '../chunk-CQCC7LE7.js';
|
|
7
|
-
import { AgentSelect } from '../chunk-
|
|
8
|
-
import '../chunk-3RJN2VTL.js';
|
|
10
|
+
import { AgentSelect } from '../chunk-VVZ34A2P.js';
|
|
9
11
|
import '../chunk-KSHKTOY2.js';
|
|
10
12
|
import '../chunk-RLWIUUQ5.js';
|
|
11
13
|
import '../chunk-P6GHJSLR.js';
|
|
12
|
-
import '../chunk-RFXJYIDV.js';
|
|
13
|
-
import '../chunk-5LXQPP2K.js';
|
|
14
|
-
import '../chunk-EVUEIBNU.js';
|
|
15
|
-
import '../chunk-444XKG46.js';
|
|
16
14
|
import '../chunk-NUNKSZKU.js';
|
|
17
15
|
import '../chunk-YU2KUMGE.js';
|
|
18
16
|
import '../chunk-N5YEF3LC.js';
|
|
17
|
+
import '../chunk-IXWJGOM2.js';
|
|
18
|
+
import '../chunk-YKQ2DPIP.js';
|
|
19
19
|
import '../chunk-4WWM3GQ5.js';
|
|
20
20
|
import { DEFAULT_STEP_KIND_LABELS, workflowSteps, dependsOn, stepLevels, runFields, upstreamSteps, stepDependencies, canAssign, WORKFLOW_STEP_KINDS, STEP_KIND_ICONS, validateWorkflowGraph, stepConfigProblems, assigneeName, orderSteps, stepKindOf } from '../chunk-PDKM27DF.js';
|
|
21
21
|
import { mergeSkillWorkflows } from '../chunk-TZGBRLPK.js';
|
|
22
|
-
import '../chunk-AA3PT6KR.js';
|
|
23
22
|
import { TONE_DOT, TONES, isTone } from '../chunk-AUS3KBHJ.js';
|
|
23
|
+
import '../chunk-AA3PT6KR.js';
|
|
24
24
|
import '../chunk-SLSBJRWW.js';
|
|
25
25
|
import '../chunk-NPLYHR2E.js';
|
|
26
26
|
import '../chunk-7F6CBP3Z.js';
|
|
27
|
-
import { useBlocksEnvironment } from '../chunk-
|
|
27
|
+
import { useBlocksEnvironment } from '../chunk-TBEVGWY3.js';
|
|
28
28
|
import '../chunk-TX2ZICS7.js';
|
|
29
29
|
import '../chunk-OXF2IFXG.js';
|
|
30
30
|
import '../chunk-VUNV25KB.js';
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
var chunkXZIYRKLW_cjs = require('../chunk-XZIYRKLW.cjs');
|
|
5
5
|
var chunkXAJIKT6Y_cjs = require('../chunk-XAJIKT6Y.cjs');
|
|
6
6
|
var chunk7G2LJMUG_cjs = require('../chunk-7G2LJMUG.cjs');
|
|
7
|
-
var
|
|
8
|
-
require('../chunk-
|
|
7
|
+
var chunkDTROMMDX_cjs = require('../chunk-DTROMMDX.cjs');
|
|
8
|
+
require('../chunk-KPZZ5FHE.cjs');
|
|
9
9
|
var chunkULWRNGGE_cjs = require('../chunk-ULWRNGGE.cjs');
|
|
10
10
|
var chunkKDG6FER6_cjs = require('../chunk-KDG6FER6.cjs');
|
|
11
11
|
require('../chunk-DES3K4SD.cjs');
|
|
@@ -52,7 +52,7 @@ function WorkspaceCardRoot({
|
|
|
52
52
|
}
|
|
53
53
|
};
|
|
54
54
|
return /* @__PURE__ */ jsxRuntime.jsx(CardContext.Provider, { value: { current, testId, labels: mergedLabels }, children: href ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
55
|
-
|
|
55
|
+
chunkDTROMMDX_cjs.ActionLink,
|
|
56
56
|
{
|
|
57
57
|
...rest,
|
|
58
58
|
href,
|
package/dist/workspaces/index.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import { CollapsibleSection, KeyValueRow } from '../chunk-LGBAZD37.js';
|
|
3
3
|
import { MemberAvatarStack } from '../chunk-XNOASBGW.js';
|
|
4
4
|
export { RoleBadge, WorkspaceTypeBadgeView } from '../chunk-NBV56SGU.js';
|
|
5
|
-
import { ActionLink } from '../chunk-
|
|
6
|
-
import '../chunk-
|
|
5
|
+
import { ActionLink } from '../chunk-YKQ2DPIP.js';
|
|
6
|
+
import '../chunk-TBEVGWY3.js';
|
|
7
7
|
import { ModalHeader } from '../chunk-TX2ZICS7.js';
|
|
8
8
|
import { fromNow, fmtDate } from '../chunk-OXF2IFXG.js';
|
|
9
9
|
import '../chunk-VUNV25KB.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/coedit",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.145",
|
|
4
4
|
"description": "Real-time collaboration for the ARBI native DOCX editor: a Yjs mirror of the canonical OOXML package, session, and server runtime",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arbidocs/blocks",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.145",
|
|
4
4
|
"description": "Composable, domain-neutral UI blocks for ARBI apps, organised by capability (retrieval, facts, agents, workspaces, citations, collaboration) plus shell, theme and site primitives, on top of @arbidocs/react.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -280,8 +280,8 @@
|
|
|
280
280
|
"example:test:e2e": "playwright test -c examples/custom-ui/playwright.config.ts"
|
|
281
281
|
},
|
|
282
282
|
"dependencies": {
|
|
283
|
-
"@arbidocs/client": "0.4.
|
|
284
|
-
"@arbidocs/coedit": "0.4.
|
|
283
|
+
"@arbidocs/client": "0.4.145",
|
|
284
|
+
"@arbidocs/coedit": "0.4.145",
|
|
285
285
|
"@dnd-kit/core": "^6.3.1",
|
|
286
286
|
"@dnd-kit/sortable": "^10.0.0",
|
|
287
287
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
"y-protocols": "^1.0.6"
|
|
325
325
|
},
|
|
326
326
|
"peerDependencies": {
|
|
327
|
-
"@arbidocs/react": "0.4.
|
|
327
|
+
"@arbidocs/react": "0.4.145",
|
|
328
328
|
"@lexical/html": "0.35.0",
|
|
329
329
|
"@lexical/link": "0.35.0",
|
|
330
330
|
"@lexical/list": "0.35.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/docx/support.tsx","../src/connection/ConnectedWorkflowLauncher.tsx","../src/connection/ConnectedWorkflowsTable.tsx","../src/connection/docx/useConnectedDocxReferences.tsx","../src/connection/docx/useConnectedHouseTemplate.ts","../src/connection/docx/ConnectedNativeDocxEditor.tsx"],"names":["jsx","useAgents","useState","useMemo","useArbi","useRef","jsxs","useWorkspaceUsers"],"mappings":";;;;;;;;;;;;;;;;AAsBA,IAAM,wBAAA,GAA2B,aAAA,CAAiC,EAAE,CAAA;AAE7D,SAAS,yBAAA,CAA0B;AAAA,EACxC,KAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,uBACE,GAAA,CAAC,wBAAA,CAAyB,QAAA,EAAzB,EAAkC,OAAe,QAAA,EAAS,CAAA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AAQ,WAAA;AAAA,MACrB,UAAA;AAAA,MACA,iBAAiB,OAAA,CAAQ,eAAA;AAAA,MACzB;AAAA,KACF,CAAA;AAAA,IACA;AAAA,MACE,IAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,WAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MACA,MAAA;AAAA,MACA,kBAAA;AAAA,MACA,OAAA;AAAA,MACA,UAAA;AAAA,MACA;AAAA;AACF,GACF;AACA,EAAA,OAAO,OAAA;AACT","file":"chunk-33ZOUJXA.js","sourcesContent":["/**\n * What a host adds to the connected Word editor that the platform API alone cannot give: the\n * workspace's definitions (facts labelled \"Definitions\"), image generation (an assistant run), the\n * host's leave-page guard, and a comment to open the editor at. Every field is optional; without a\n * provider the editor simply offers less (no Defined term, no Generate image).\n */\n\nimport { createContext, useContext, type ReactNode } from 'react'\nimport type { DefinitionSource } from '../../tags/definitions'\nimport type { DocxImageGeneration } from '../../docx/layout/GenerateImage'\n\nexport interface NativeDocxSupport {\n /** The workspace's definitions. Present: Insert offers Defined term and `@@` the type-ahead. */\n definitions?: () => Promise<DefinitionSource[]>\n /** The platform's image generation. Present: Insert offers Generate image. */\n imageGeneration?: DocxImageGeneration\n /** The open editor has (or no longer has) unsaved changes. */\n onDirtyChange?: (dirty: boolean) => void\n /** A comment thread to open when its document opens (a notification's link). */\n commentTarget?: { documentId: string; commentId: string } | null\n}\n\nconst NativeDocxSupportContext = createContext<NativeDocxSupport>({})\n\nexport function NativeDocxSupportProvider({\n value,\n children,\n}: {\n value: NativeDocxSupport\n children: ReactNode\n}) {\n return (\n <NativeDocxSupportContext.Provider value={value}>{children}</NativeDocxSupportContext.Provider>\n )\n}\n\nexport function useNativeDocxSupport(): NativeDocxSupport {\n return useContext(NativeDocxSupportContext)\n}\n","/**\n * The workflow launcher bound to the connection: the open workspace's folders, labels and files\n * behind its scope and `documents` fields (files can be added right there), and the user's agents\n * behind \"Run as\". The host still says what a launch does (`onLaunch`): open a chat, start a task.\n */\n\nimport { useCallback, useMemo, useRef, useState } from 'react'\nimport { useAgents, useArbi, useThumbnails } from '@arbidocs/react'\nimport { WorkflowLauncher, type WorkflowLauncherProps } from '../agents/workflows/WorkflowLauncher'\nimport {\n WorkflowDocumentsField,\n type WorkflowDocumentsFieldLabels,\n type WorkflowFieldDocument,\n} from '../agents/workflows/WorkflowDocumentsField'\nimport type { WorkflowScopeSource } from '../agents/workflows/WorkflowConfigDialog'\nimport { buildWorkflowScopeSource, documentScopeLabels } from '../agents/workflows/workspaceScope'\nimport type { AgentOption } from '../agents/workflows/AgentSelect'\nimport type { WorkflowField, WorkflowScope } from '../agents/workflows/types'\nimport { useBlocksEnvironment } from '../provider/BlocksProvider'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedDocuments, useConnectedTags, type ConnectedDocument } from './workspaceData'\n\nconst IMAGE_FILE_TYPES = new Set(['png', 'jpg', 'jpeg', 'gif', 'bmp', 'tiff', 'webp'])\n\n/** A workspace document as a `documents` field offers it. */\nexport function toWorkflowFieldDocument(doc: ConnectedDocument): WorkflowFieldDocument {\n // Pages and tokens are a text-parsing concept: never meaningful for an image.\n const isImage = IMAGE_FILE_TYPES.has((doc.file_type ?? '').toLowerCase())\n return {\n id: doc.external_id,\n title: doc.doc_metadata?.title || doc.file_name || doc.external_id,\n fileName: doc.file_name,\n pages: isImage ? null : (doc.n_pages ?? null),\n tokens: isImage ? null : (doc.tokens ?? null),\n status: doc.status,\n isImage,\n }\n}\n\n/** The open workspace's folders and labels for a workflow's scope field. */\nexport function useConnectedWorkflowScopeSource(): WorkflowScopeSource {\n const { data: docs } = useConnectedDocuments()\n const { data: tags } = useConnectedTags()\n return useMemo(() => buildWorkflowScopeSource(docs, documentScopeLabels(tags)), [docs, tags])\n}\n\n/** The user's agents, for \"Run as\". */\nexport function useConnectedAgentOptions(): AgentOption[] {\n const { data: agents } = useAgents()\n return useMemo(\n () => (agents ?? []).map((a) => ({ id: a.external_id, label: a.given_name || a.email })),\n [agents]\n )\n}\n\nexport interface ConnectedWorkflowDocumentsFieldProps {\n field: WorkflowField\n value: WorkflowScope\n onChange: (value: WorkflowScope) => void\n /** Add files the host's way (its upload dialog). Absent: they are uploaded here. */\n onAddFiles?: (files?: File[]) => void\n labels?: Partial<WorkflowDocumentsFieldLabels>\n}\n\n/**\n * A workflow `documents` field over the open workspace's files: pick, add (or drop) files, see the\n * chosen images. A launcher's or a task composer's `renderDocuments`.\n */\nexport function ConnectedWorkflowDocumentsField({\n field,\n value,\n onChange,\n onAddFiles,\n labels,\n}: ConnectedWorkflowDocumentsFieldProps) {\n const arbi = useArbi()\n const { notify } = useBlocksEnvironment()\n const { ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: docs, loaded, refetch } = useConnectedDocuments()\n const documents = useMemo(() => docs.map(toWorkflowFieldDocument), [docs])\n const chosen = value.documents ?? []\n const { data: thumbnails } = useThumbnails(chosen, { enabled: (field.max ?? 1) > 1 })\n const input = useRef<HTMLInputElement>(null)\n const [adding, setAdding] = useState(false)\n\n const upload = useCallback(\n async (files: File[]) => {\n setAdding(true)\n try {\n await ensureWorkspaceOpen()\n for (const file of files) await arbi.documents.uploadFile(file, file.name)\n } catch (error) {\n notify(error instanceof Error && error.message ? error.message : String(error), 'error')\n } finally {\n setAdding(false)\n await refetch?.()\n }\n },\n [arbi, ensureWorkspaceOpen, notify, refetch]\n )\n\n return (\n <>\n {!onAddFiles && (\n <input\n ref={input}\n type=\"file\"\n multiple\n className=\"hidden\"\n aria-label=\"Add files\"\n data-testid=\"workflow-add-files-input\"\n onChange={(e) => {\n const files = Array.from(e.target.files ?? [])\n e.target.value = ''\n if (files.length) void upload(files)\n }}\n />\n )}\n <WorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n documents={documents}\n loaded={loaded}\n thumbnailOf={(id) => thumbnails?.[id]}\n onAddFiles={\n onAddFiles ?? ((files) => (files?.length ? void upload(files) : input.current?.click()))\n }\n adding={adding}\n labels={labels}\n />\n </>\n )\n}\n\nexport interface ConnectedWorkflowLauncherProps extends Omit<\n WorkflowLauncherProps,\n 'scopeSource' | 'renderDocuments' | 'agents'\n> {\n /** Add files from a `documents` field the host's way (its upload dialog). Absent: uploaded here. */\n onAddFiles?: (files?: File[]) => void\n}\n\nexport function ConnectedWorkflowLauncher({\n onAddFiles,\n ...props\n}: ConnectedWorkflowLauncherProps) {\n const scopeSource = useConnectedWorkflowScopeSource()\n const agents = useConnectedAgentOptions()\n return (\n <WorkflowLauncher\n {...props}\n scopeSource={scopeSource}\n agents={agents}\n renderDocuments={(field, value, onChange) => (\n <ConnectedWorkflowDocumentsField\n field={field}\n value={value}\n onChange={onChange}\n onAddFiles={onAddFiles}\n />\n )}\n />\n )\n}\n","/**\n * The saved workflows bound to the connection: when each starts, its last run (a link to the thread\n * it created) and next run, who runs it, pause and resume, share, run now, delete (one or many), and\n * the workflow's history. The host opens a workflow (its builder) and its history; threads open\n * through the environment's `openConversation`, failures are told through its `notify`.\n */\n\nimport { useEffect, useMemo, useState } from 'react'\nimport {\n useAgents,\n useDeleteWorkflow,\n useRunWorkflow,\n useUpdateWorkflow,\n useWorkflows,\n useWorkspaceUsers,\n type WorkflowResponse,\n} from '@arbidocs/react'\nimport { WorkflowsTable, type WorkflowsTableProps } from '../agents/tasks/WorkflowsTable'\nimport { workflowTriggerType } from '../agents/tasks/workflowRows'\nimport { fmtDate } from '../lib/format'\nimport { useBlocksEnvironment } from '../provider/BlocksProvider'\nimport { useConnectedWorkspace } from './ConnectionProvider'\nimport { useConnectedConversations } from './workspaceData'\n\n/** The viewer's role in the open workspace, and the workspace's members. */\nexport function useConnectedWorkspaceRole() {\n const { workspaceId, live, userId, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: members = [] } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const role = members.find((m) => m.user.external_id === userId)?.role\n return {\n members,\n role,\n /** An owner or a collaborator edits, pauses, resumes and runs what is shared with the workspace. */\n canEditShared: role === 'owner' || role === 'collaborator',\n /** With an item's creator, the only one who deletes it. */\n isWorkspaceOwner: role === 'owner',\n }\n}\n\nexport interface ConnectedWorkflowsTableLabels {\n /** A change (pause, share, delete) that failed without a message. */\n updateFailed: string\n deleteTitle: string\n deleteOne: (name: string) => string\n deleteMany: (count: number) => string\n /** A run that failed: its history has the error report. */\n runFailed: string\n /** A run that created no thread. */\n noThread: string\n /** A document action that started (it has no thread): what is happening. */\n documentAction: (workflow: WorkflowResponse) => string\n untitledTask: string\n}\n\nexport const DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS: ConnectedWorkflowsTableLabels = {\n updateFailed: 'Could not update the workflow',\n deleteTitle: 'Delete workflow',\n deleteOne: (name) => `Delete “${name}”? Threads it already created stay.`,\n deleteMany: (count) => `Delete ${count} workflows? Threads they already created stay.`,\n runFailed: 'The workflow failed. You can send an error report from its history.',\n noThread: 'The workflow did not create a thread.',\n documentAction: (workflow) =>\n workflow.action?.type === 'email_documents'\n ? 'Preparing your document email'\n : 'Reviewing documents',\n untitledTask: 'Untitled thread',\n}\n\ntype TableProps = WorkflowsTableProps<WorkflowResponse>\n\nexport interface ConnectedWorkflowsTableProps extends Omit<\n TableProps,\n | 'workflows'\n | 'isLoading'\n | 'busyId'\n | 'describeTrigger'\n | 'formatDate'\n | 'onToggleActive'\n | 'onToggleShared'\n | 'onDelete'\n | 'onDeleteMany'\n | 'onToggleActiveMany'\n | 'onRun'\n | 'onOpenThread'\n | 'lastRuns'\n | 'agentNames'\n | 'taskNames'\n | 'canEditShared'\n | 'isWorkspaceOwner'\n> {\n /** Which saved workflows to list (e.g. those on a schedule). Default: all. */\n filter?: (workflow: WorkflowResponse) => boolean\n /** When a workflow starts, in the host's words. Default: its trigger type. */\n describeTrigger?: TableProps['describeTrigger']\n formatDate?: TableProps['formatDate']\n connectedLabels?: Partial<ConnectedWorkflowsTableLabels>\n}\n\nconst messageOf = (error: unknown) => (error instanceof Error ? error.message : '')\n\nexport function ConnectedWorkflowsTable({\n filter,\n describeTrigger = (w) => workflowTriggerType(w).replaceAll('_', ' '),\n formatDate = fmtDate,\n onViewRuns,\n connectedLabels,\n ...tableProps\n}: ConnectedWorkflowsTableProps) {\n const l = { ...DEFAULT_CONNECTED_WORKFLOWS_TABLE_LABELS, ...connectedLabels }\n const { notify, confirm, openConversation } = useBlocksEnvironment()\n const { canEditShared, isWorkspaceOwner } = useConnectedWorkspaceRole()\n const { data: saved = [], isLoading } = useWorkflows({ live: true })\n const { data: conversations, refetch } = useConnectedConversations({ live: true })\n const { data: agents = [] } = useAgents()\n const update = useUpdateWorkflow()\n const remove = useDeleteWorkflow()\n const run = useRunWorkflow()\n const [busyId, setBusyId] = useState<string | null>(null)\n\n const workflows = useMemo(() => (filter ? saved.filter(filter) : saved), [saved, filter])\n // A clock or an event fired a workflow: the thread it created is new to the conversation list.\n const firingStamp = saved.map((w) => `${w.external_id}:${w.last_fired_at ?? ''}`).join('|')\n useEffect(() => {\n void refetch?.()\n }, [firingStamp, refetch])\n\n const lastRuns = useMemo(() => {\n const out: NonNullable<TableProps['lastRuns']> = {}\n for (const c of conversations) {\n const id = c.workflow_ext_id\n if (id && (!out[id] || Date.parse(c.created_at) > Date.parse(out[id].at)))\n out[id] = { conversationId: c.external_id, at: c.created_at, threadStatus: c.status }\n }\n return out\n }, [conversations])\n const agentNames = useMemo(\n () => Object.fromEntries(agents.map((a) => [a.external_id, a.given_name || a.email])),\n [agents]\n )\n const taskNames = useMemo(\n () =>\n Object.fromEntries(\n conversations\n .filter((c) => c.status != null)\n .map((c) => [c.external_id, c.title || l.untitledTask])\n ),\n [conversations, l.untitledTask]\n )\n\n const act = async (workflow: WorkflowResponse, action: () => Promise<unknown>) => {\n setBusyId(workflow.external_id)\n try {\n await action()\n } catch (error) {\n notify(messageOf(error) || l.updateFailed, 'error')\n } finally {\n setBusyId(null)\n }\n }\n const setActive = (workflow: WorkflowResponse, active: boolean) =>\n act(workflow, () => update.mutateAsync({ workflowId: workflow.external_id, patch: { active } }))\n const deleteAll = async (items: WorkflowResponse[]) => {\n if (!items.length) return\n const ok = await confirm({\n title: l.deleteTitle,\n message: items.length === 1 ? l.deleteOne(items[0].name) : l.deleteMany(items.length),\n })\n if (!ok) return\n for (const workflow of items)\n await act(workflow, () => remove.mutateAsync(workflow.external_id))\n }\n\n return (\n <WorkflowsTable\n {...tableProps}\n workflows={workflows}\n isLoading={isLoading}\n busyId={busyId}\n describeTrigger={describeTrigger}\n formatDate={formatDate}\n agentNames={agentNames}\n taskNames={taskNames}\n lastRuns={lastRuns}\n canEditShared={canEditShared}\n isWorkspaceOwner={isWorkspaceOwner}\n onOpenThread={(conversationId) => openConversation(conversationId)}\n onViewRuns={onViewRuns}\n onToggleActive={(workflow, active) => void setActive(workflow, active)}\n onToggleActiveMany={(items, active) => {\n void (async () => {\n for (const workflow of items) await setActive(workflow, active)\n })()\n }}\n onToggleShared={(workflow, shared) =>\n void act(workflow, () =>\n update.mutateAsync({ workflowId: workflow.external_id, patch: { shared } })\n )\n }\n onDelete={(workflow) => void deleteAll([workflow])}\n onDeleteMany={(items) => void deleteAll(items)}\n onRun={(workflow) =>\n void act(workflow, async () => {\n const result = await run.mutateAsync(workflow.external_id)\n if (result.conversation_ext_id) openConversation(result.conversation_ext_id)\n if (result.error) {\n onViewRuns?.(workflow)\n notify(l.runFailed, 'error')\n return\n }\n if (result.execution_id && !result.conversation_ext_id) {\n // A document action runs without a thread: its history shows how it goes.\n onViewRuns?.(workflow)\n notify(l.documentAction(workflow), 'success')\n return\n }\n if (!result.conversation_ext_id) throw new Error(l.noThread)\n })\n }\n />\n )\n}\n","/**\n * The Word editor's references to the workspace's other documents: the documents and their\n * passages (the same parsed passages a fact's citations quote), the ARBI address of a passage\n * (`/wrk-…/doc-…/cnk-…`, the deep link that opens a document at a passage, so the link works from\n * Word too), and opening one wherever the host shows documents, highlighted like a citation.\n */\nimport { useMemo, useRef } from 'react'\nimport { useArbi } from '@arbidocs/react'\nimport type { DocxReferencesAdapter } from '../../docx/references/CrossReferences'\nimport { DocumentPicker } from '../../settings/DocumentPicker'\nimport { buildDeepLinkUrl, parseDeepLinkPath } from '../../lib/deep-link'\nimport { useBlocksEnvironment } from '../../provider/BlocksProvider'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { toWorkflowFieldDocument } from '../ConnectedWorkflowLauncher'\nimport { useConnectedDocuments, type ConnectedDocument } from '../workspaceData'\n\ninterface ParsedChunk {\n content?: string | null\n metadata?: { chunk_ext_id?: string | null; page_number?: number | null } | null\n}\n\n/** Top-level documents only: an attachment opens with its parent. */\nconst isTopLevel = (doc: ConnectedDocument) => !doc.parent_ext_id\n\nfunction ReferencePicker({\n documents,\n selectedId,\n onSelect,\n}: {\n documents: ConnectedDocument[]\n selectedId: string | null\n onSelect: (documentId: string) => void\n}) {\n const groups = useMemo(() => {\n const docs = documents\n .filter(isTopLevel)\n .map(toWorkflowFieldDocument)\n .sort((a, b) => a.title.toLowerCase().localeCompare(b.title.toLowerCase()))\n return [{ id: 'all', heading: 'In this workspace', docs }]\n }, [documents])\n const selected = groups[0].docs.find((d) => d.id === selectedId)\n return (\n <DocumentPicker\n groups={groups}\n value={selectedId ?? ''}\n onValueChange={onSelect}\n selected={selected}\n labels={{ placeholder: 'Search documents…' }}\n />\n )\n}\n\nexport function useConnectedDocxReferences(): DocxReferencesAdapter {\n const arbi = useArbi()\n const { workspaceId } = useConnectedWorkspace()\n const { openDocument, runtimeConfig } = useBlocksEnvironment()\n const { data: documents } = useConnectedDocuments()\n // Read when called (the picker, a link): the list grows while the editor is open.\n const documentsRef = useRef(documents)\n documentsRef.current = documents\n return useMemo<DocxReferencesAdapter>(\n () => ({\n documents: async () =>\n documentsRef.current\n .filter(isTopLevel)\n .map((d) => ({ id: d.external_id, title: toWorkflowFieldDocument(d).title })),\n passages: async (documentId) => {\n const parsed = await arbi.documents.getParsedContent(documentId, 'final')\n return ((parsed.chunks ?? []) as ParsedChunk[]).flatMap((chunk) =>\n chunk.metadata?.chunk_ext_id && chunk.content?.trim()\n ? [\n {\n chunkId: chunk.metadata.chunk_ext_id,\n page: chunk.metadata.page_number ?? null,\n text: chunk.content,\n },\n ]\n : []\n )\n },\n linkFor: ({ documentId, chunkId, page }) => {\n const url = buildDeepLinkUrl(\n { workspaceId: workspaceId ?? undefined, documentId, chunkId },\n runtimeConfig.deploymentDomain\n )\n return page ? `${url}?page=${page}` : url\n },\n targetOf: (href) => {\n let url: URL\n try {\n url = new URL(href, window.location.origin)\n } catch {\n return null\n }\n const { documentId, chunkId } = parseDeepLinkPath(url.pathname)\n if (!documentId || !chunkId) return null\n const page = Number(url.searchParams.get('page')) || null\n return { documentId, chunkId, page }\n },\n open: ({ documentId, chunkId, page }) =>\n openDocument(documentId, { passageId: chunkId, page: page ?? undefined }),\n renderDocumentPicker: (onSelect, selectedId) => (\n <ReferencePicker\n documents={documentsRef.current}\n selectedId={selectedId}\n onSelect={onSelect}\n />\n ),\n }),\n [arbi, workspaceId, openDocument, runtimeConfig.deploymentDomain]\n )\n}\n","/**\n * The house template for the open workspace: its own (a document of the workspace), else the\n * deployment's default, else ARBI's built-in legal template. A workspace owner can make a document\n * the house template once the server supports it.\n */\nimport { useMemo } from 'react'\nimport {\n supportsHouseTemplates,\n useArbi,\n useHouseTemplateCandidates,\n useSetWorkspaceHouseTemplate,\n useWorkspaces,\n workspaceHouseTemplateId,\n} from '@arbidocs/react'\nimport { contentPath } from '../../docx/NativeDocxEditor'\nimport {\n builtinHouseTemplate,\n type HouseTemplate,\n type HouseTemplateHost,\n} from '../../docx/template/HouseTemplate'\nimport { isCandidate } from '../../docx/template/candidates'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useConnectedWorkspaceRole } from '../ConnectedWorkflowsTable'\n\nexport function useConnectedHouseTemplate(): HouseTemplateHost {\n const arbi = useArbi()\n const { mutateAsync: setWorkspaceTemplate } = useSetWorkspaceHouseTemplate()\n const { workspaceId, live, ensureWorkspaceOpen } = useConnectedWorkspace()\n const { data: workspaces } = useWorkspaces({ enabled: live })\n const workspace = workspaces?.find((w) => w.external_id === workspaceId)\n const { isWorkspaceOwner } = useConnectedWorkspaceRole()\n const supported = supportsHouseTemplates(workspace)\n const templateId = workspaceHouseTemplateId(workspace)\n // Only an eligible document (shared, Word, here or in a public workspace) is offered as the template.\n const { data: candidates } = useHouseTemplateCandidates(\n workspaceId,\n supported && isWorkspaceOwner\n )\n return useMemo<HouseTemplateHost>(\n () => ({\n load: async (): Promise<HouseTemplate> => {\n if (templateId) {\n await ensureWorkspaceOpen()\n const response = await arbi.editor.request(contentPath(templateId))\n const [record] = await arbi.documents.get([templateId]).catch(() => [])\n return {\n bytes: new Uint8Array(await response.arrayBuffer()),\n name: record?.file_name ?? 'House template.docx',\n source: 'workspace',\n documentId: templateId,\n }\n }\n if (supported) {\n const deployment = await arbi.houseTemplates.deployment()\n if (deployment) return { ...deployment, source: 'deployment' }\n }\n return builtinHouseTemplate()\n },\n setFromDocument:\n supported && isWorkspaceOwner\n ? async (documentId) => {\n await ensureWorkspaceOpen()\n await setWorkspaceTemplate(documentId)\n }\n : undefined,\n isEligible: (documentId) => isCandidate(candidates, documentId),\n }),\n [\n arbi,\n setWorkspaceTemplate,\n supported,\n templateId,\n isWorkspaceOwner,\n candidates,\n ensureWorkspaceOpen,\n ]\n )\n}\n","import { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { arbiQueryKeys, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport { useOptionalDocumentTools } from '@arbidocs/react/document-tools'\nimport {\n NativeDocxEditor,\n type NativeDocxAdapter,\n type NativeDocxEditorProps,\n} from '../../docx/NativeDocxEditor'\nimport { loadDocxFonts } from '../../docx/fonts'\nimport { useRegisterOpenDocument } from '../../chat/open-document'\nimport { useBlocksEnvironment } from '../../provider/BlocksProvider'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (a `ConnectionProvider`, or\n * the host's own `ArbiProvider` + session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const { commentTarget } = useNativeDocxSupport()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent && !props.compact\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (`NativeDocxSupportProvider`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: async (id, state) =>\n (\n await arbi.editor.request(`/${encodeURIComponent(id)}/save`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ state }),\n })\n ).json(),\n loadFonts: () => loadDocxFonts(fontBaseUrl),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n onVersionSaved: async (id) => {\n // The host's own lists (a documents grid) learn of the new version too.\n const hostRefresh = onDocumentsChanged?.([id], 'version')\n if (workspaceId) {\n const key = arbiQueryKeys.documents(workspaceId)\n try {\n const documents = await arbi.documents.get([id])\n if (!documents.length) throw new Error('The saved version is not available yet.')\n queries.setQueryData<Awaited<ReturnType<typeof arbi.documents.list>>>(\n key,\n (previous) => [\n ...documents,\n ...(previous || []).filter(\n (doc) => !documents.some((saved) => saved.external_id === doc.external_id)\n ),\n ]\n )\n } catch {\n await queries.invalidateQueries({ queryKey: key })\n }\n }\n await hostRefresh\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n workspaceId,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n ]\n )\n return adapter\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/workspaceData.tsx"],"names":[],"mappings":";;;;;AA+BA,IAAM,oBAAA,GAAuB,aAAA,CAAsC,EAAE,CAAA;AAE9D,SAAS,8BAAA,CAA+B;AAAA,EAC7C,SAAA;AAAA,EACA,IAAA;AAAA,EACA,aAAA;AAAA,EACA;AACF,CAAA,EAAqD;AACnD,EAAA,MAAM,KAAA,GAAQ,OAAA;A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AAA,CAAQ,QAAQ,GAAG,CAAA;AAC5B;AAMO,SAAS,0BAA0B,OAAA,EAEK;AAC7C,EAAA,MAAM,MAAA,GAAS,UAAA,CAAW,oBAAoB,CAAA,CAAE,aAAA;AAChD,EAAA,MAAM,EAAE,WAAA,EAAY,GAAI,qBAAA,EAAsB;AAC9C,EAAA,MAAM,GAAA,GAAM,gBAAA,CAAiB,WAAA,IAAe,MAAA,EAAW,EAAE,OAAA,EAAS,CAAC,MAAA,EAAQ,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,CAAA;AAChG,EAAA,OAAO,OAAA,CAAQ,QAAQ,GAAG,CAAA;AAC5B","file":"chunk-45LRMW54.js","sourcesContent":["/**\n * The open workspace's documents, tags and conversations for the connected kits. By default each kit reads them\n * through the `@arbidocs/react` hooks. A host that already keeps these lists live in its own cache\n * (the ARBI app, with its progressive loader and WebSocket patches) passes them once through\n * `ConnectedWorkspaceDataProvider`, so the kits show the same list and nothing is fetched twice.\n */\n\nimport { createContext, useContext, useMemo, type ReactNode } from 'react'\nimport { useConversations, useDocuments, useTags } from '@arbidocs/react'\nimport { useConnectedWorkspace } from './ConnectionProvider'\n\nexport type ConnectedDocument = NonNullable<ReturnType<typeof useDocuments>['data']>[number]\nexport type ConnectedTag = NonNullable<ReturnType<typeof useTags>['data']>[number]\nexport type ConnectedConversation = NonNullable<ReturnType<typeof useConversations>['data']>[number]\n\n/**\n * A list the host keeps: its rows, whether it has arrived, and how to read it again (absent: the\n * host keeps it current itself, so a kit never re-reads it).\n */\nexport interface ConnectedList<T> {\n data: T[] | undefined\n isFetched: boolean\n refetch?: () => unknown\n}\n\nexport interface ConnectedWorkspaceData {\n documents?: ConnectedList<ConnectedDocument>\n tags?: ConnectedList<ConnectedTag>\n conversations?: ConnectedList<ConnectedConversation>\n}\n\nconst WorkspaceDataContext = createContext<ConnectedWorkspaceData>({})\n\nexport function ConnectedWorkspaceDataProvider({\n documents,\n tags,\n conversations,\n children,\n}: ConnectedWorkspaceData & { children: ReactNode }) {\n const value = useMemo(\n () => ({ documents, tags, conversations }),\n [documents, tags, conversations]\n )\n return <WorkspaceDataContext.Provider value={value}>{children}</WorkspaceDataContext.Provider>\n}\n\nexport interface ConnectedListResult<T> {\n data: T[]\n loaded: boolean\n /** Read the list again after a change made here; absent when the host keeps it current. */\n refetch?: () => unknown\n}\n\nconst EMPTY: never[] = []\n\nfunction useList<T>(\n hosted: ConnectedList<T> | undefined,\n own: { data?: T[]; isFetched: boolean; refetch: () => unknown }\n): ConnectedListResult<T> {\n const source = hosted ?? own\n const data = source.data ?? (EMPTY as T[])\n const refetch = hosted ? hosted.refetch : own.refetch\n return useMemo(\n () => ({ data, loaded: source.isFetched, refetch }),\n [data, source.isFetched, refetch]\n )\n}\n\n/** The open workspace's documents: the host's list when it gives one, else read here. */\nexport function useConnectedDocuments(): ConnectedListResult<ConnectedDocument> {\n const hosted = useContext(WorkspaceDataContext).documents\n const { workspaceId } = useConnectedWorkspace()\n const own = useDocuments(workspaceId ?? undefined, { enabled: !hosted })\n return useList(hosted, own)\n}\n\n/** The open workspace's tags: the host's list when it gives one, else read here. */\nexport function useConnectedTags(): ConnectedListResult<ConnectedTag> {\n const hosted = useContext(WorkspaceDataContext).tags\n const { workspaceId } = useConnectedWorkspace()\n const own = useTags(workspaceId ?? undefined, { enabled: !hosted })\n return useList(hosted, own)\n}\n\n/**\n * The open workspace's conversations (threads and tasks): the host's list when it gives one, else\n * read here (`live`: re-read while shown, as a run moves on by itself).\n */\nexport function useConnectedConversations(options?: {\n live?: boolean\n}): ConnectedListResult<ConnectedConversation> {\n const hosted = useContext(WorkspaceDataContext).conversations\n const { workspaceId } = useConnectedWorkspace()\n const own = useConversations(workspaceId ?? undefined, { enabled: !hosted, live: options?.live })\n return useList(hosted, own)\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/provider/dialogs.tsx","../src/provider/BlocksProvider.tsx"],"names":["useState","jsx","ModalScaffold","Info","Alert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CAAO,aAAA;AAAA,MACvC,YAAA,EAAc,gBAAgB,MAAA,CAAO,YAAA;AAAA,MACrC,gBAAA,EAAkB,oBAAoB,MAAA,CAAO,gBAAA;AAAA,MAC7C,YAAA,EAAc,gBAAgB,MAAA,CAAO,YAAA;AAAA,MACrC,WAAA,EAAa,eAAe,MAAA,CAAO;AAAA,KACrC,CAAA;AAAA,IACA;AAAA,MACE,MAAA;AAAA,MACA,aAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,aAAA;AAAA,MACA,YAAA;AAAA,MACA,gBAAA;AAAA,MACA,YAAA;AAAA,MACA;AAAA;AACF,GACF;AACA,EAAA,uBAAOR,cAAAA,CAAC,aAAA,CAAc,QAAA,EAAd,EAAuB,OAAe,QAAA,EAAS,CAAA;AACzD;AAEO,SAAS,oBAAA,GAA0C;AACxD,EAAA,OAAOO,iBAAW,aAAa,CAAA;AACjC","file":"chunk-C4WSHRR6.cjs","sourcesContent":["/**\n * Promise-based prompt dialogs — the blocks replacement for `window.confirm` / `window.alert`.\n * Each call mounts its own short-lived React root, so it works from any event handler with no\n * dialog host in the tree. Hosts reach these through `useBlocksEnvironment().confirm` / `.choose`\n * (the defaults), which lets an app swap in its own dialogs without touching callers.\n *\n * For a confirmation with a loading state, render the declarative {@link ConfirmDialog} instead.\n */\nimport { useState, type ReactElement } from 'react'\nimport { AlertCircle, Info } from 'lucide-react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../settings/ModalScaffold'\n\ntype ChoiceVariant = 'default' | 'destructive' | 'outline'\n\nexport interface PromptChoice<T extends string> {\n label: string\n value: T\n variant?: ChoiceVariant\n}\n\n/** A dialog offering arbitrary choices (e.g. Overwrite / Skip / Cancel). */\nexport interface ChoiceRequest<T extends string> {\n message: string\n title?: string\n choices: PromptChoice<T>[]\n icon?: 'alert' | 'info'\n /** Dialog test id; each button is `${testId}-${value}-button`. Default `choice-modal`. */\n testId?: string\n}\n\n/**\n * `confirm` — Cancel / Confirm (destructive); `yesno` — No / Yes; `alert` — a single OK\n * (resolves true once acknowledged).\n */\nexport type ConfirmKind = 'confirm' | 'yesno' | 'alert'\n\nexport interface ConfirmRequest {\n message: string\n /** Default: \"Alert\" for `alert`, else \"Confirm\". */\n title?: string\n kind?: ConfirmKind\n}\n\n/** Close animation length before the root is unmounted. */\nconst UNMOUNT_DELAY_MS = 300\n\nfunction PromptDialog<T extends string>({\n request,\n onSettle,\n}: {\n request: ChoiceRequest<T>\n onSettle: (value: T | null) => void\n}): ReactElement {\n const [open, setOpen] = useState(true)\n const { message, title = 'Confirm', choices, icon = 'alert', testId = 'choice-modal' } = request\n const settle = (value: T | null) => {\n setOpen(false)\n onSettle(value)\n }\n return (\n <ModalScaffold\n open={open}\n onOpenChange={(next) => {\n if (!next) settle(null)\n }}\n title={title}\n icon={\n icon === 'info' ? (\n <Info className=\"h-5 w-5 text-blue-text\" aria-hidden=\"true\" />\n ) : (\n <AlertCircle className=\"h-5 w-5\" aria-hidden=\"true\" />\n )\n }\n description={<span className=\"whitespace-pre-line\">{message}</span>}\n showDescription\n testId={testId}\n >\n <ModalScaffold.Footer>\n {choices.map((choice) => (\n <Button\n key={choice.value}\n variant={choice.variant ?? 'default'}\n onClick={() => settle(choice.value)}\n data-testid={`${testId}-${choice.value.toLowerCase()}-button`}\n >\n {choice.label}\n </Button>\n ))}\n </ModalScaffold.Footer>\n </ModalScaffold>\n )\n}\n\n/** Show a choice dialog; resolves with the chosen `value`, or `null` when dismissed. */\nexport function choiceDialog<T extends string>(request: ChoiceRequest<T>): Promise<T | null> {\n if (typeof document === 'undefined') return Promise.resolve(null)\n return new Promise((resolve) => {\n const container = document.createElement('div')\n document.body.appendChild(container)\n let settled = false\n void import('react-dom/client').then(({ createRoot }) => {\n const root = createRoot(container)\n const onSettle = (value: T | null) => {\n if (settled) return\n settled = true\n resolve(value)\n setTimeout(() => {\n root.unmount()\n container.remove()\n }, UNMOUNT_DELAY_MS)\n }\n root.render(<PromptDialog request={request} onSettle={onSettle} />)\n })\n })\n}\n\nconst CONFIRM_CHOICES: Record<\n ConfirmKind,\n PromptChoice<'confirm' | 'cancel' | 'yes' | 'no' | 'ok'>[]\n> = {\n confirm: [\n { label: 'Cancel', value: 'cancel', variant: 'outline' },\n { label: 'Confirm', value: 'confirm', variant: 'destructive' },\n ],\n yesno: [\n { label: 'No', value: 'no', variant: 'outline' },\n { label: 'Yes', value: 'yes' },\n ],\n alert: [{ label: 'OK', value: 'ok' }],\n}\n\nconst CONFIRM_TEST_ID: Record<ConfirmKind, string> = {\n confirm: 'confirmation-modal',\n yesno: 'yes-no-modal',\n alert: 'alert-modal',\n}\n\n/** Show a confirmation; resolves true on Confirm / Yes / OK, false on cancel or dismissal. */\nexport async function confirmDialog(request: ConfirmRequest): Promise<boolean> {\n const kind = request.kind ?? 'confirm'\n const choice = await choiceDialog({\n message: request.message,\n title: request.title ?? (kind === 'alert' ? 'Alert' : 'Confirm'),\n choices: CONFIRM_CHOICES[kind],\n icon: kind === 'alert' ? 'info' : 'alert',\n testId: CONFIRM_TEST_ID[kind],\n })\n return choice === 'confirm' || choice === 'yes' || choice === 'ok'\n}\n","import { createContext, useContext, useMemo, type ReactNode } from 'react'\nimport {\n notify as notifyStore,\n type NotifyOptions,\n type NotifyVariant,\n} from '@arbidocs/react/shell'\nimport type { BlockLinkComponent } from '../components/blockLink'\nimport { choiceDialog, confirmDialog, type ChoiceRequest, type ConfirmRequest } from './dialogs'\n\n/** What blocks need from the host's runtime configuration (the app's `config.json`). */\nexport interface BlocksRuntimeConfig {\n /** Origin of the ARBI API; `''` means the page's own origin. */\n apiBaseUrl: string\n /** The deployment's domain, e.g. `www.arbidocs.com` (deep links, key derivation, labels). */\n deploymentDomain: string\n}\n\nexport interface OpenDocumentOptions {\n /** 1-based page to scroll to. */\n page?: number\n /** Passage (chunk) to highlight. */\n passageId?: string\n}\n\n/**\n * The only way blocks reach the host app's environment. Blocks never import a router, a toast\n * library or an app store; the host injects what it has, and every field has a safe default so a\n * block renders correctly with no provider at all. A nested provider overrides only the fields\n * it is given and inherits the rest.\n */\nexport interface BlocksEnvironment {\n /** Router-aware link (keeps navigation in-SPA). Default: a plain `<a href>`. */\n linkComponent?: BlockLinkComponent\n /** Imperative navigation for buttons and keyboard shortcuts. Default: `window.location.assign`. */\n navigate: (href: string) => void\n /** Surface a transient message (and record it in the notification centre). Default: the shared\n * `@arbidocs/react` notify store, rendered by its `<Toaster/>`. */\n notify: (message: ReactNode, kind?: NotifyVariant, options?: NotifyOptions) => void\n /** Ask the user to confirm. Default: the blocks prompt dialog. */\n confirm: (request: ConfirmRequest) => Promise<boolean>\n /** Ask the user to pick one of several choices; `null` when dismissed. Default: the blocks\n * prompt dialog. */\n choose: <T extends string>(request: ChoiceRequest<T>) => Promise<T | null>\n /** Deployment configuration. Default: same-origin API on the page's own host. */\n runtimeConfig: BlocksRuntimeConfig\n /** Open a document (optionally at a page / passage) wherever the host shows documents.\n * Default: no-op. */\n openDocument: (documentId: string, options?: OpenDocumentOptions) => void\n /** Open a conversation thread, optionally scrolled to a message. Default: no-op. */\n openConversation: (conversationId: string, options?: { messageId?: string }) => void\n /** Open the user's settings, optionally at a section. Default: no-op. */\n openSettings: (section?: string) => void\n /** Open a project. Default: no-op. */\n openProject: (projectId: string) => void\n}\n\nconst noop = () => {}\n\nconst defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\n runtimeConfig: {\n apiBaseUrl: '',\n deploymentDomain: typeof window !== 'undefined' ? window.location.host : '',\n },\n openDocument: noop,\n openConversation: noop,\n openSettings: noop,\n openProject: noop,\n}\n\nconst BlocksContext = createContext<BlocksEnvironment>(defaultEnvironment)\n\nexport interface BlocksProviderProps extends Partial<BlocksEnvironment> {\n children: ReactNode\n}\n\nexport function BlocksProvider({\n children,\n linkComponent,\n navigate,\n notify,\n confirm,\n choose,\n runtimeConfig,\n openDocument,\n openConversation,\n openSettings,\n openProject,\n}: BlocksProviderProps) {\n const parent = useContext(BlocksContext)\n const value = useMemo<BlocksEnvironment>(\n () => ({\n linkComponent: linkComponent ?? parent.linkComponent,\n navigate: navigate ?? parent.navigate,\n notify: notify ?? parent.notify,\n confirm: confirm ?? parent.confirm,\n choose: choose ?? parent.choose,\n runtimeConfig: runtimeConfig ?? parent.runtimeConfig,\n openDocument: openDocument ?? parent.openDocument,\n openConversation: openConversation ?? parent.openConversation,\n openSettings: openSettings ?? parent.openSettings,\n openProject: openProject ?? parent.openProject,\n }),\n [\n parent,\n linkComponent,\n navigate,\n notify,\n confirm,\n choose,\n runtimeConfig,\n openDocument,\n openConversation,\n openSettings,\n openProject,\n ]\n )\n return <BlocksContext.Provider value={value}>{children}</BlocksContext.Provider>\n}\n\nexport function useBlocksEnvironment(): BlocksEnvironment {\n return useContext(BlocksContext)\n}\n"]}
|