@arbidocs/blocks 0.5.173 → 0.5.175
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/{ConnectedCallDock-AQRVWENO.cjs → ConnectedCallDock-LW7S4ROJ.cjs} +10 -10
- package/dist/{ConnectedCallDock-AQRVWENO.cjs.map → ConnectedCallDock-LW7S4ROJ.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-7M4YQ4KA.cjs → ConnectedCallRoom-YXJUNNUX.cjs} +9 -9
- package/dist/{ConnectedCallRoom-7M4YQ4KA.cjs.map → ConnectedCallRoom-YXJUNNUX.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-KGUSDMDH.cjs → ConnectedNativeDocxComparison-AAQJZYZH.cjs} +9 -9
- package/dist/{ConnectedNativeDocxComparison-KGUSDMDH.cjs.map → ConnectedNativeDocxComparison-AAQJZYZH.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-FOYVUVM3.cjs → ConnectedPresentation-LNDESKYE.cjs} +6 -6
- package/dist/{ConnectedPresentation-FOYVUVM3.cjs.map → ConnectedPresentation-LNDESKYE.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-ERKIDFFG.cjs → ConnectedStreamedWordArtifact-CSNA2CJD.cjs} +9 -9
- package/dist/{ConnectedStreamedWordArtifact-ERKIDFFG.cjs.map → ConnectedStreamedWordArtifact-CSNA2CJD.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-EYJ5Q4F4.cjs → DocumentReviewCard-LOUVMFRX.cjs} +14 -14
- package/dist/{DocumentReviewCard-EYJ5Q4F4.cjs.map → DocumentReviewCard-LOUVMFRX.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-AZUR4XBV.cjs → FilesViewerDialog-2NZR4MHD.cjs} +14 -14
- package/dist/{FilesViewerDialog-AZUR4XBV.cjs.map → FilesViewerDialog-2NZR4MHD.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-YQERZOHV.cjs → WorkspaceTableView-LGDLG3TX.cjs} +4 -4
- package/dist/{WorkspaceTableView-YQERZOHV.cjs.map → WorkspaceTableView-LGDLG3TX.cjs.map} +1 -1
- package/dist/agents/index.cjs +172 -172
- package/dist/agents/runs/AgentBar.js +1 -1
- package/dist/agents/runs/AgentBar.js.map +2 -2
- package/dist/{ai-U2UMKQZO.cjs → ai-NZKIMYW5.cjs} +14 -14
- package/dist/ai-NZKIMYW5.cjs.map +1 -0
- package/dist/calls/index.cjs +45 -45
- package/dist/chat/Message.js +2 -1
- package/dist/chat/Message.js.map +2 -2
- package/dist/chat/index.cjs +55 -55
- package/dist/{chunk-2KGU5G6Z.cjs → chunk-5E6ZQ5EO.cjs} +234 -37
- package/dist/chunk-5E6ZQ5EO.cjs.map +1 -0
- package/dist/{chunk-D5QGLBQC.cjs → chunk-5G33DATM.cjs} +36 -36
- package/dist/{chunk-D5QGLBQC.cjs.map → chunk-5G33DATM.cjs.map} +1 -1
- package/dist/{chunk-QHXFXV2F.cjs → chunk-5YLNNO3N.cjs} +4 -4
- package/dist/{chunk-QHXFXV2F.cjs.map → chunk-5YLNNO3N.cjs.map} +1 -1
- package/dist/{chunk-GPPPH37H.cjs → chunk-6DHDITKK.cjs} +3 -3
- package/dist/{chunk-GPPPH37H.cjs.map → chunk-6DHDITKK.cjs.map} +1 -1
- package/dist/{chunk-IJBCEBGR.cjs → chunk-7OMRSZOJ.cjs} +28 -28
- package/dist/{chunk-IJBCEBGR.cjs.map → chunk-7OMRSZOJ.cjs.map} +1 -1
- package/dist/{chunk-IJ4JKHEC.cjs → chunk-7TEHA3JK.cjs} +18 -18
- package/dist/{chunk-IJ4JKHEC.cjs.map → chunk-7TEHA3JK.cjs.map} +1 -1
- package/dist/{chunk-TNBNDY2J.cjs → chunk-7VUO4QZH.cjs} +4 -4
- package/dist/{chunk-TNBNDY2J.cjs.map → chunk-7VUO4QZH.cjs.map} +1 -1
- package/dist/{chunk-XGMA7ITI.cjs → chunk-A257IJ5J.cjs} +6 -6
- package/dist/{chunk-XGMA7ITI.cjs.map → chunk-A257IJ5J.cjs.map} +1 -1
- package/dist/{chunk-CHZ6SPOT.cjs → chunk-DI6UEQCZ.cjs} +4 -4
- package/dist/{chunk-CHZ6SPOT.cjs.map → chunk-DI6UEQCZ.cjs.map} +1 -1
- package/dist/{chunk-5PZZRBAG.cjs → chunk-DVRAM3J4.cjs} +4 -4
- package/dist/{chunk-5PZZRBAG.cjs.map → chunk-DVRAM3J4.cjs.map} +1 -1
- package/dist/{chunk-TMK5YVNN.cjs → chunk-EBY2JHL3.cjs} +56 -56
- package/dist/{chunk-TMK5YVNN.cjs.map → chunk-EBY2JHL3.cjs.map} +1 -1
- package/dist/{chunk-RBNMRU4V.cjs → chunk-GAHGZBBM.cjs} +23 -23
- package/dist/{chunk-RBNMRU4V.cjs.map → chunk-GAHGZBBM.cjs.map} +1 -1
- package/dist/{chunk-H2BUDSKT.cjs → chunk-HSYRI3JQ.cjs} +6 -6
- package/dist/{chunk-H2BUDSKT.cjs.map → chunk-HSYRI3JQ.cjs.map} +1 -1
- package/dist/{chunk-O2D4VIWD.cjs → chunk-LYJFE37D.cjs} +11 -11
- package/dist/{chunk-O2D4VIWD.cjs.map → chunk-LYJFE37D.cjs.map} +1 -1
- package/dist/{chunk-K7JV2OV3.cjs → chunk-MXP32DA2.cjs} +6 -6
- package/dist/{chunk-K7JV2OV3.cjs.map → chunk-MXP32DA2.cjs.map} +1 -1
- package/dist/{chunk-ZUQGG3FL.cjs → chunk-MZPBZSKS.cjs} +16 -16
- package/dist/{chunk-ZUQGG3FL.cjs.map → chunk-MZPBZSKS.cjs.map} +1 -1
- package/dist/{chunk-TF3JNVHS.cjs → chunk-NFXHBTAO.cjs} +4 -4
- package/dist/{chunk-TF3JNVHS.cjs.map → chunk-NFXHBTAO.cjs.map} +1 -1
- package/dist/{chunk-MGI5FR6I.cjs → chunk-NTQJHLYM.cjs} +9 -9
- package/dist/{chunk-MGI5FR6I.cjs.map → chunk-NTQJHLYM.cjs.map} +1 -1
- package/dist/{chunk-4BOX77K3.cjs → chunk-OIMDCS4Y.cjs} +5 -5
- package/dist/{chunk-4BOX77K3.cjs.map → chunk-OIMDCS4Y.cjs.map} +1 -1
- package/dist/{chunk-FX5TZ6JU.cjs → chunk-OIYKKUAN.cjs} +3 -3
- package/dist/{chunk-FX5TZ6JU.cjs.map → chunk-OIYKKUAN.cjs.map} +1 -1
- package/dist/{chunk-7VZHGEA4.cjs → chunk-PUKLWHV6.cjs} +6 -6
- package/dist/{chunk-7VZHGEA4.cjs.map → chunk-PUKLWHV6.cjs.map} +1 -1
- package/dist/{chunk-U2L4GTMV.cjs → chunk-PXC6RSHQ.cjs} +4 -4
- package/dist/{chunk-U2L4GTMV.cjs.map → chunk-PXC6RSHQ.cjs.map} +1 -1
- package/dist/{chunk-ZOI4DFSB.cjs → chunk-SZ4U6GYC.cjs} +31 -31
- package/dist/{chunk-ZOI4DFSB.cjs.map → chunk-SZ4U6GYC.cjs.map} +1 -1
- package/dist/{chunk-6PKP7UT7.cjs → chunk-TAGA6LNP.cjs} +8 -8
- package/dist/{chunk-6PKP7UT7.cjs.map → chunk-TAGA6LNP.cjs.map} +1 -1
- package/dist/{chunk-QDXZVJWN.cjs → chunk-TNVCTYZI.cjs} +37 -13
- package/dist/{chunk-QDXZVJWN.cjs.map → chunk-TNVCTYZI.cjs.map} +1 -1
- package/dist/{chunk-THGWHKWR.cjs → chunk-VCVB2OP7.cjs} +54 -47
- package/dist/chunk-VCVB2OP7.cjs.map +1 -0
- package/dist/{chunk-HYUKPHCT.cjs → chunk-WJIAA6G3.cjs} +12 -3
- package/dist/chunk-WJIAA6G3.cjs.map +1 -0
- package/dist/{chunk-7FWP7W34.cjs → chunk-Z574BY3H.cjs} +4 -4
- package/dist/{chunk-7FWP7W34.cjs.map → chunk-Z574BY3H.cjs.map} +1 -1
- package/dist/{chunk-KBRDUFXG.cjs → chunk-ZHLBTIJJ.cjs} +4 -3
- package/dist/chunk-ZHLBTIJJ.cjs.map +1 -0
- package/dist/{chunk-WQ3GB74G.cjs → chunk-ZSQZZGC7.cjs} +5 -5
- package/dist/{chunk-WQ3GB74G.cjs.map → chunk-ZSQZZGC7.cjs.map} +1 -1
- package/dist/{chunk-2ZNADJ7G.cjs → chunk-ZT6C4MNX.cjs} +4 -4
- package/dist/{chunk-2ZNADJ7G.cjs.map → chunk-ZT6C4MNX.cjs.map} +1 -1
- package/dist/collaboration/direct-messages/DmParts.d.ts +3 -1
- package/dist/collaboration/direct-messages/DmParts.js +36 -12
- package/dist/collaboration/direct-messages/DmParts.js.map +2 -2
- package/dist/collaboration/index.cjs +69 -69
- package/dist/connect/docx.cjs +12 -12
- package/dist/connect/index.cjs +932 -856
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +12 -12
- package/dist/connection/contacts/ConnectedContactsPanel.js +2 -2
- package/dist/connection/contacts/ConnectedContactsPanel.js.map +2 -2
- package/dist/connection/contacts/ConnectedInviteContactsDialog.js +2 -2
- package/dist/connection/contacts/ConnectedInviteContactsDialog.js.map +2 -2
- package/dist/connection/conversation/ConnectedConversation.js +1 -2
- package/dist/connection/conversation/ConnectedConversation.js.map +2 -2
- package/dist/connection/conversation/MessageLiveSeconds.d.ts +2 -1
- package/dist/connection/conversation/MessageLiveSeconds.js +8 -1
- package/dist/connection/conversation/MessageLiveSeconds.js.map +2 -2
- package/dist/connection/entities/ConnectedUserEntity.js +3 -8
- package/dist/connection/entities/ConnectedUserEntity.js.map +2 -2
- package/dist/connection/messenger/ConnectedChatMessageBody.d.ts +2 -1
- package/dist/connection/messenger/ConnectedChatMessageBody.js +14 -2
- package/dist/connection/messenger/ConnectedChatMessageBody.js.map +2 -2
- package/dist/connection/messenger/ConnectedChatThread.js +71 -20
- package/dist/connection/messenger/ConnectedChatThread.js.map +2 -2
- package/dist/connection/messenger/ConnectedMessenger.js +59 -52
- package/dist/connection/messenger/ConnectedMessenger.js.map +2 -2
- package/dist/connection/messenger/DmAgentProgress.d.ts +2 -1
- package/dist/connection/messenger/DmAgentProgress.js +17 -4
- package/dist/connection/messenger/DmAgentProgress.js.map +2 -2
- package/dist/connection/panels/ConnectedPanelHost.js +1 -1
- package/dist/connection/panels/ConnectedPanelHost.js.map +2 -2
- package/dist/connection/settings-page/SessionStatusIcon.js +1 -1
- package/dist/connection/settings-page/SessionStatusIcon.js.map +1 -1
- package/dist/connection/settings-page/featuresSection.js +1 -1
- package/dist/connection/settings-page/featuresSection.js.map +2 -2
- package/dist/embed/index.cjs +17 -17
- package/dist/files/index.cjs +227 -227
- package/dist/index.cjs +373 -373
- package/dist/pages/index.cjs +18 -18
- package/dist/settings/FloatingPanel.js +10 -1
- package/dist/settings/FloatingPanel.js.map +2 -2
- package/dist/settings/index.cjs +2 -2
- package/dist/shell/FloatingAssistantSurface.d.ts +6 -0
- package/dist/shell/FloatingAssistantSurface.js +165 -0
- package/dist/shell/FloatingAssistantSurface.js.map +7 -0
- package/dist/shell/PanelPortal.d.ts +12 -0
- package/dist/shell/PanelPortal.js +6 -15
- package/dist/shell/PanelPortal.js.map +2 -2
- package/dist/shell/floating-assistant-context.d.ts +2 -0
- package/dist/shell/floating-assistant-context.js +7 -0
- package/dist/shell/floating-assistant-context.js.map +7 -0
- package/dist/shell/index.cjs +3 -3
- package/dist/shell/useFloatingDrag.d.ts +1 -0
- package/dist/shell/useFloatingDrag.js +69 -21
- package/dist/shell/useFloatingDrag.js.map +2 -2
- package/dist/site/index.cjs +5 -5
- package/dist/studio/index.cjs +6 -6
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +30 -30
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ai-U2UMKQZO.cjs.map +0 -1
- package/dist/chunk-2KGU5G6Z.cjs.map +0 -1
- package/dist/chunk-HYUKPHCT.cjs.map +0 -1
- package/dist/chunk-KBRDUFXG.cjs.map +0 -1
- package/dist/chunk-THGWHKWR.cjs.map +0 -1
package/dist/pages/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkK5F2VNCX_cjs = require('../chunk-K5F2VNCX.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkOIMDCS4Y_cjs = require('../chunk-OIMDCS4Y.cjs');
|
|
6
6
|
require('../chunk-DWRUGOTQ.cjs');
|
|
7
7
|
require('../chunk-KD66CBYO.cjs');
|
|
8
8
|
require('../chunk-OHWYQI3B.cjs');
|
|
@@ -10,17 +10,17 @@ require('../chunk-ER2MRSLT.cjs');
|
|
|
10
10
|
require('../chunk-UNSZLNA4.cjs');
|
|
11
11
|
var chunkJ5CBCUQE_cjs = require('../chunk-J5CBCUQE.cjs');
|
|
12
12
|
require('../chunk-JWCVA4LC.cjs');
|
|
13
|
-
var
|
|
13
|
+
var chunk6DHDITKK_cjs = require('../chunk-6DHDITKK.cjs');
|
|
14
14
|
require('../chunk-223D4727.cjs');
|
|
15
15
|
require('../chunk-DTMBAFIL.cjs');
|
|
16
16
|
require('../chunk-SNUBQMIS.cjs');
|
|
17
17
|
require('../chunk-SOT7NPIB.cjs');
|
|
18
18
|
require('../chunk-3EIO4ZH5.cjs');
|
|
19
|
-
var chunkN33U2SB5_cjs = require('../chunk-N33U2SB5.cjs');
|
|
20
19
|
var chunkPJ5OQ5VB_cjs = require('../chunk-PJ5OQ5VB.cjs');
|
|
21
20
|
var chunkYSAUOJA7_cjs = require('../chunk-YSAUOJA7.cjs');
|
|
22
21
|
var chunkJ37DOAGN_cjs = require('../chunk-J37DOAGN.cjs');
|
|
23
22
|
require('../chunk-QEMGGJB6.cjs');
|
|
23
|
+
var chunkN33U2SB5_cjs = require('../chunk-N33U2SB5.cjs');
|
|
24
24
|
var chunkMWHVETKN_cjs = require('../chunk-MWHVETKN.cjs');
|
|
25
25
|
var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
|
|
26
26
|
require('../chunk-7G2LJMUG.cjs');
|
|
@@ -42,9 +42,9 @@ require('../chunk-6UZC4XVV.cjs');
|
|
|
42
42
|
require('../chunk-DKY67DA6.cjs');
|
|
43
43
|
require('../chunk-SQCCQU3K.cjs');
|
|
44
44
|
require('../chunk-UDSHVNU3.cjs');
|
|
45
|
-
require('../chunk-ZVEW3JBT.cjs');
|
|
46
45
|
require('../chunk-ZQQVXRYZ.cjs');
|
|
47
46
|
require('../chunk-IPSHAMO2.cjs');
|
|
47
|
+
require('../chunk-ZVEW3JBT.cjs');
|
|
48
48
|
var chunkMHIG6GGS_cjs = require('../chunk-MHIG6GGS.cjs');
|
|
49
49
|
require('../chunk-VG24E4JJ.cjs');
|
|
50
50
|
require('../chunk-U2FFG2B3.cjs');
|
|
@@ -74,7 +74,7 @@ var documentTools = require('@arbidocs/react/document-tools');
|
|
|
74
74
|
var viewers = require('@arbidocs/react/viewers');
|
|
75
75
|
|
|
76
76
|
var PAGE_TEMPLATES = [
|
|
77
|
-
|
|
77
|
+
chunkOIMDCS4Y_cjs.WORKSPACE_DASHBOARD_PAGE,
|
|
78
78
|
...chunkYSAUOJA7_cjs.DASHBOARD_TEMPLATES
|
|
79
79
|
];
|
|
80
80
|
function pageOfTemplate(template) {
|
|
@@ -1255,7 +1255,7 @@ function WithNewFileMenu({ children }) {
|
|
|
1255
1255
|
const [open, setOpen] = react$1.useState(false);
|
|
1256
1256
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1257
1257
|
children(() => setOpen(true)),
|
|
1258
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1258
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkOIMDCS4Y_cjs.ConnectedNewFileMenu, { open, onOpenChange: setOpen })
|
|
1259
1259
|
] });
|
|
1260
1260
|
}
|
|
1261
1261
|
function PageBlockView({
|
|
@@ -1336,18 +1336,18 @@ function PageBlockView({
|
|
|
1336
1336
|
) });
|
|
1337
1337
|
case "list":
|
|
1338
1338
|
return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: block.config.source === "documents" ? /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1339
|
-
|
|
1339
|
+
chunkOIMDCS4Y_cjs.ConnectedListBlock,
|
|
1340
1340
|
{
|
|
1341
1341
|
config: block.config,
|
|
1342
1342
|
onCreateNew,
|
|
1343
1343
|
testId: testId && `${testId}-list`
|
|
1344
1344
|
}
|
|
1345
|
-
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1345
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx(chunkOIMDCS4Y_cjs.ConnectedListBlock, { config: block.config, testId: testId && `${testId}-list` }) });
|
|
1346
1346
|
case "carousel":
|
|
1347
|
-
return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1347
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(chunkOIMDCS4Y_cjs.ConnectedCarouselBlock, { config: block.config, testId: testId && `${testId}-carousel` }) });
|
|
1348
1348
|
case "agenda":
|
|
1349
1349
|
return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1350
|
-
|
|
1350
|
+
chunkOIMDCS4Y_cjs.ConnectedAgendaBlock,
|
|
1351
1351
|
{
|
|
1352
1352
|
config: block.config,
|
|
1353
1353
|
className: "border-0 p-0",
|
|
@@ -1355,7 +1355,7 @@ function PageBlockView({
|
|
|
1355
1355
|
}
|
|
1356
1356
|
) });
|
|
1357
1357
|
case "start":
|
|
1358
|
-
return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1358
|
+
return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(chunkOIMDCS4Y_cjs.ConnectedStartBlock, { onCreateNew }) }) });
|
|
1359
1359
|
}
|
|
1360
1360
|
}
|
|
1361
1361
|
function NewPageButton({
|
|
@@ -1611,8 +1611,8 @@ function OpenPageTransferDialog({
|
|
|
1611
1611
|
}) {
|
|
1612
1612
|
const l = { ...DEFAULT_PAGE_TRANSFER_LABELS, ...labels };
|
|
1613
1613
|
const { notify } = chunkHN56WWBR_cjs.useBlocksEnvironment();
|
|
1614
|
-
const { options, nameOf } =
|
|
1615
|
-
const trackTransfer =
|
|
1614
|
+
const { options, nameOf } = chunkOIMDCS4Y_cjs.useTransferTargets();
|
|
1615
|
+
const trackTransfer = chunkOIMDCS4Y_cjs.useExportStore((state) => state.trackTransfer);
|
|
1616
1616
|
const [targetId, setTargetId] = react$1.useState(null);
|
|
1617
1617
|
const [references, setReferences] = react$1.useState("link");
|
|
1618
1618
|
const [jobId, setJobId] = react$1.useState(null);
|
|
@@ -1624,7 +1624,7 @@ function OpenPageTransferDialog({
|
|
|
1624
1624
|
isFetching: isPlanning,
|
|
1625
1625
|
refetch: refetchPlan
|
|
1626
1626
|
} = react.usePlanWorkspaceTransfer(scope, mode, { enabled: !jobId });
|
|
1627
|
-
const failure =
|
|
1627
|
+
const failure = chunkOIMDCS4Y_cjs.planFailure(planError);
|
|
1628
1628
|
const start = react.useStartWorkspaceTransfer();
|
|
1629
1629
|
const cancel = react.useCancelWorkspaceTransfer();
|
|
1630
1630
|
const switchToPages = react.useSwitchToWorkspacePages();
|
|
@@ -1669,7 +1669,7 @@ function OpenPageTransferDialog({
|
|
|
1669
1669
|
if (!jobId) {
|
|
1670
1670
|
body = /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2", children: [
|
|
1671
1671
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1672
|
-
|
|
1672
|
+
chunk6DHDITKK_cjs.ExportWorkspacePicker,
|
|
1673
1673
|
{
|
|
1674
1674
|
workspaces: options,
|
|
1675
1675
|
selectedId: targetId,
|
|
@@ -1678,7 +1678,7 @@ function OpenPageTransferDialog({
|
|
|
1678
1678
|
}
|
|
1679
1679
|
),
|
|
1680
1680
|
documents > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1681
|
-
|
|
1681
|
+
chunk6DHDITKK_cjs.TransferReferencesChooser,
|
|
1682
1682
|
{
|
|
1683
1683
|
value: references,
|
|
1684
1684
|
onChange: setReferences,
|
|
@@ -1692,7 +1692,7 @@ function OpenPageTransferDialog({
|
|
|
1692
1692
|
),
|
|
1693
1693
|
views > 0 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "pt-2 text-sm text-muted-foreground", "data-testid": `${testId}-views`, children: l.viewsStay(views) }),
|
|
1694
1694
|
failure && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pt-2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1695
|
-
|
|
1695
|
+
chunk6DHDITKK_cjs.TransferPlanError,
|
|
1696
1696
|
{
|
|
1697
1697
|
detail: typeof failure === "string" ? failure : void 0,
|
|
1698
1698
|
onRetry: () => void refetchPlan(),
|
|
@@ -1726,7 +1726,7 @@ function OpenPageTransferDialog({
|
|
|
1726
1726
|
] });
|
|
1727
1727
|
} else if (!finished || !items) {
|
|
1728
1728
|
body = job ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1729
|
-
|
|
1729
|
+
chunk6DHDITKK_cjs.TransferProgressView,
|
|
1730
1730
|
{
|
|
1731
1731
|
title: l.progress(mode, target),
|
|
1732
1732
|
processed: job.processed ?? 0,
|
|
@@ -14,7 +14,16 @@ function FloatingPanel({
|
|
|
14
14
|
}) {
|
|
15
15
|
const isRenderFunction = typeof children === "function";
|
|
16
16
|
const content = isRenderFunction ? children({ modeSwitcher }) : children;
|
|
17
|
-
const body = /* @__PURE__ */ jsx(
|
|
17
|
+
const body = /* @__PURE__ */ jsx(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: cn(
|
|
21
|
+
"min-h-0 flex-1",
|
|
22
|
+
isRenderFunction ? "flex flex-col overflow-hidden" : "overflow-auto p-3"
|
|
23
|
+
),
|
|
24
|
+
children: content
|
|
25
|
+
}
|
|
26
|
+
);
|
|
18
27
|
if (mode === "popout") {
|
|
19
28
|
return /* @__PURE__ */ jsxs(
|
|
20
29
|
"div",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/settings/FloatingPanel.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { MouseEventHandler, ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { TabHeader } from '../shell/TabHeader'\n\n/** Where a panel is placed: pinned beside the page, full width, floating, or its own window. */\nexport type FloatingPanelMode = 'docked' | 'main' | 'overlay' | 'popout'\n\nexport interface FloatingPanelControls {\n /** The mode switcher + close button, for children that render their own header. */\n modeSwitcher: ReactNode\n}\n\nexport interface FloatingPanelProps {\n /** Stable id of the panel (also the id of its single header tab). */\n panelId: string\n mode: FloatingPanelMode\n title: string\n subtitle?: string\n /** Mode switcher + close button, supplied by the host so it owns window management. */\n modeSwitcher: ReactNode\n /** Content, or a render function for children that embed `modeSwitcher` in their own header. */\n children: ReactNode | ((controls: FloatingPanelControls) => ReactNode)\n /** Click anywhere on the panel (the host tracks which panel is focused). */\n onPanelClick?: MouseEventHandler<HTMLDivElement>\n className?: string\n}\n\n/**\n * Presentational frame of a floating panel: header (title / tab + mode switcher) and scrolling\n * body. Placement and window management live in the host.\n */\nexport function FloatingPanel({\n panelId,\n mode,\n title,\n subtitle,\n modeSwitcher,\n children,\n onPanelClick,\n className,\n}: FloatingPanelProps) {\n const isRenderFunction = typeof children === 'function'\n const content = isRenderFunction ? children({ modeSwitcher }) : children\n\n const body = (\n <div
|
|
5
|
-
"mappings": ";AA6CI,
|
|
4
|
+
"sourcesContent": ["import type { MouseEventHandler, ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { TabHeader } from '../shell/TabHeader'\n\n/** Where a panel is placed: pinned beside the page, full width, floating, or its own window. */\nexport type FloatingPanelMode = 'docked' | 'main' | 'overlay' | 'popout'\n\nexport interface FloatingPanelControls {\n /** The mode switcher + close button, for children that render their own header. */\n modeSwitcher: ReactNode\n}\n\nexport interface FloatingPanelProps {\n /** Stable id of the panel (also the id of its single header tab). */\n panelId: string\n mode: FloatingPanelMode\n title: string\n subtitle?: string\n /** Mode switcher + close button, supplied by the host so it owns window management. */\n modeSwitcher: ReactNode\n /** Content, or a render function for children that embed `modeSwitcher` in their own header. */\n children: ReactNode | ((controls: FloatingPanelControls) => ReactNode)\n /** Click anywhere on the panel (the host tracks which panel is focused). */\n onPanelClick?: MouseEventHandler<HTMLDivElement>\n className?: string\n}\n\n/**\n * Presentational frame of a floating panel: header (title / tab + mode switcher) and scrolling\n * body. Placement and window management live in the host.\n */\nexport function FloatingPanel({\n panelId,\n mode,\n title,\n subtitle,\n modeSwitcher,\n children,\n onPanelClick,\n className,\n}: FloatingPanelProps) {\n const isRenderFunction = typeof children === 'function'\n const content = isRenderFunction ? children({ modeSwitcher }) : children\n\n const body = (\n <div\n className={cn(\n 'min-h-0 flex-1',\n isRenderFunction ? 'flex flex-col overflow-hidden' : 'overflow-auto p-3'\n )}\n >\n {content}\n </div>\n )\n\n if (mode === 'popout') {\n return (\n <div\n data-slot=\"floating-panel\"\n className={cn('flex h-screen flex-col bg-background text-foreground', className)}\n >\n {!isRenderFunction && (\n <div className=\"flex flex-shrink-0 items-start justify-between border-b border-border px-3 py-2\">\n <div className=\"flex min-w-0 flex-1 flex-col\">\n {title && (\n <div className=\"flex items-center gap-2 text-base font-semibold text-primary\">\n <span>{title}</span>\n </div>\n )}\n {subtitle && <span className=\"text-sm text-muted-foreground\">{subtitle}</span>}\n </div>\n {modeSwitcher}\n </div>\n )}\n {body}\n </div>\n )\n }\n\n return (\n <div\n data-slot=\"floating-panel\"\n data-mode={mode}\n className={cn('flex h-full flex-col bg-background text-foreground', className)}\n onClick={onPanelClick}\n >\n {!isRenderFunction && (\n <TabHeader\n tabs={[{ id: panelId, label: title }]}\n activeTabId={panelId}\n onTabChange={() => {}}\n rightContent={modeSwitcher}\n />\n )}\n {body}\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA6CI,cAkBQ,YAlBR;AA5CJ,SAAS,UAAU;AACnB,SAAS,iBAAiB;AA6BnB,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,mBAAmB,OAAO,aAAa;AAC7C,QAAM,UAAU,mBAAmB,SAAS,EAAE,aAAa,CAAC,IAAI;AAEhE,QAAM,OACJ;AAAA,IAAC;AAAA;AAAA,MACC,WAAW;AAAA,QACT;AAAA,QACA,mBAAmB,kCAAkC;AAAA,MACvD;AAAA,MAEC;AAAA;AAAA,EACH;AAGF,MAAI,SAAS,UAAU;AACrB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,aAAU;AAAA,QACV,WAAW,GAAG,wDAAwD,SAAS;AAAA,QAE9E;AAAA,WAAC,oBACA,qBAAC,SAAI,WAAU,mFACb;AAAA,iCAAC,SAAI,WAAU,gCACZ;AAAA,uBACC,oBAAC,SAAI,WAAU,gEACb,8BAAC,UAAM,iBAAM,GACf;AAAA,cAED,YAAY,oBAAC,UAAK,WAAU,iCAAiC,oBAAS;AAAA,eACzE;AAAA,YACC;AAAA,aACH;AAAA,UAED;AAAA;AAAA;AAAA,IACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAU;AAAA,MACV,aAAW;AAAA,MACX,WAAW,GAAG,sDAAsD,SAAS;AAAA,MAC7E,SAAS;AAAA,MAER;AAAA,SAAC,oBACA;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,CAAC,EAAE,IAAI,SAAS,OAAO,MAAM,CAAC;AAAA,YACpC,aAAa;AAAA,YACb,aAAa,MAAM;AAAA,YAAC;AAAA,YACpB,cAAc;AAAA;AAAA,QAChB;AAAA,QAED;AAAA;AAAA;AAAA,EACH;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/settings/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunkJEHGTPS2_cjs = require('../chunk-JEHGTPS2.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkWJIAA6G3_cjs = require('../chunk-WJIAA6G3.cjs');
|
|
6
6
|
var chunkJWCVA4LC_cjs = require('../chunk-JWCVA4LC.cjs');
|
|
7
7
|
var chunkQQMMCXBP_cjs = require('../chunk-QQMMCXBP.cjs');
|
|
8
8
|
var chunk223D4727_cjs = require('../chunk-223D4727.cjs');
|
|
@@ -564,7 +564,7 @@ Object.defineProperty(exports, "serverConnectionView", {
|
|
|
564
564
|
});
|
|
565
565
|
Object.defineProperty(exports, "FloatingPanel", {
|
|
566
566
|
enumerable: true,
|
|
567
|
-
get: function () { return
|
|
567
|
+
get: function () { return chunkWJIAA6G3_cjs.FloatingPanel; }
|
|
568
568
|
});
|
|
569
569
|
Object.defineProperty(exports, "DEFAULT_EMAIL_WORKSPACE_DIALOG_LABELS", {
|
|
570
570
|
enumerable: true,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** A persistent launcher and one compact surface; collapsing never discards the conversation. */
|
|
2
|
+
export declare function FloatingAssistantSurface({ children, dragging, position, }: {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
dragging: boolean;
|
|
5
|
+
position?: string;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from "react";
|
|
4
|
+
import { ArbiBotHeadIcon } from "@arbidocs/react/ui";
|
|
5
|
+
import { FloatingAssistantIdentity } from "./floating-assistant-context.js";
|
|
6
|
+
function FloatingAssistantSurface({
|
|
7
|
+
children,
|
|
8
|
+
dragging,
|
|
9
|
+
position
|
|
10
|
+
}) {
|
|
11
|
+
const root = useRef(null);
|
|
12
|
+
const surfaceId = useId();
|
|
13
|
+
const lastSize = useRef({ width: 400, height: 380 });
|
|
14
|
+
const preferredDirection = useRef({ up: true, left: true });
|
|
15
|
+
const wasDragging = useRef(false);
|
|
16
|
+
const [identity, setIdentity] = useState({ name: "Assistant", working: false });
|
|
17
|
+
const updateIdentity = useCallback((name, working) => {
|
|
18
|
+
setIdentity((old) => old.name === name && old.working === working ? old : { name, working });
|
|
19
|
+
}, []);
|
|
20
|
+
const [hovered, setHovered] = useState(false);
|
|
21
|
+
const [focused, setFocused] = useState(false);
|
|
22
|
+
const [expanded, setExpanded] = useState(false);
|
|
23
|
+
const [placement, setPlacement] = useState({ up: true, left: true, width: 400, height: 380 });
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
if (dragging) {
|
|
26
|
+
wasDragging.current = true;
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (!root.current) return;
|
|
30
|
+
const dropped = wasDragging.current;
|
|
31
|
+
wasDragging.current = false;
|
|
32
|
+
const measure = () => {
|
|
33
|
+
const box = root.current.getBoundingClientRect();
|
|
34
|
+
const boundary = root.current.closest("[data-floating-boundary]")?.getBoundingClientRect();
|
|
35
|
+
const top = (boundary?.top ?? 0) + 12;
|
|
36
|
+
const bottom = Math.min(window.innerHeight, boundary?.bottom ?? window.innerHeight) - 12;
|
|
37
|
+
const surface = root.current.querySelector("[data-floating-surface]")?.getBoundingClientRect();
|
|
38
|
+
if (surface?.width && surface.height) lastSize.current = surface;
|
|
39
|
+
setPlacement(() => {
|
|
40
|
+
const preferred = preferredDirection.current;
|
|
41
|
+
const keepHorizontal = preferred.left ? box.right - 12 >= lastSize.current.width : window.innerWidth - box.left - 12 >= lastSize.current.width;
|
|
42
|
+
const keepVertical = preferred.up ? box.bottom - top >= lastSize.current.height : bottom - box.top >= lastSize.current.height;
|
|
43
|
+
const up = keepVertical ? preferred.up : box.top >= (top + bottom) / 2;
|
|
44
|
+
const left = keepHorizontal ? preferred.left : box.left >= window.innerWidth / 2;
|
|
45
|
+
if (dropped) preferredDirection.current = { up, left };
|
|
46
|
+
return {
|
|
47
|
+
up,
|
|
48
|
+
left,
|
|
49
|
+
width: Math.min(400, left ? box.right - 12 : window.innerWidth - box.left - 12),
|
|
50
|
+
height: Math.max(96, Math.min(380, up ? box.bottom - top : bottom - box.top))
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
measure();
|
|
55
|
+
window.addEventListener("resize", measure);
|
|
56
|
+
return () => window.removeEventListener("resize", measure);
|
|
57
|
+
}, [dragging, position, expanded]);
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
const surface = root.current.querySelector("[data-floating-surface]");
|
|
60
|
+
const observer = new ResizeObserver(() => {
|
|
61
|
+
const box = surface.getBoundingClientRect();
|
|
62
|
+
if (box.width && box.height) lastSize.current = box;
|
|
63
|
+
});
|
|
64
|
+
observer.observe(surface);
|
|
65
|
+
return () => observer.disconnect();
|
|
66
|
+
}, []);
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
if (dragging) return;
|
|
69
|
+
const timer = setTimeout(() => setExpanded(hovered || focused), hovered || focused ? 80 : 350);
|
|
70
|
+
return () => clearTimeout(timer);
|
|
71
|
+
}, [hovered, focused, dragging]);
|
|
72
|
+
const open = () => {
|
|
73
|
+
setExpanded(true);
|
|
74
|
+
requestAnimationFrame(() => root.current?.querySelector("textarea")?.focus());
|
|
75
|
+
};
|
|
76
|
+
const reserveLauncher = placement.left ? "pr-16" : "pl-16";
|
|
77
|
+
return /* @__PURE__ */ jsx(FloatingAssistantIdentity.Provider, { value: updateIdentity, children: /* @__PURE__ */ jsxs(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
ref: root,
|
|
81
|
+
"data-testid": "floating-assistant",
|
|
82
|
+
"data-expanded": expanded,
|
|
83
|
+
className: "relative size-12 pointer-events-none",
|
|
84
|
+
onPointerEnter: () => setHovered(true),
|
|
85
|
+
onPointerLeave: () => {
|
|
86
|
+
setHovered(false);
|
|
87
|
+
if (!document.activeElement || document.activeElement === document.body || !document.activeElement.isConnected)
|
|
88
|
+
setFocused(false);
|
|
89
|
+
},
|
|
90
|
+
onFocusCapture: () => setFocused(true),
|
|
91
|
+
onBlurCapture: (event) => {
|
|
92
|
+
if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false);
|
|
93
|
+
},
|
|
94
|
+
children: [
|
|
95
|
+
/* @__PURE__ */ jsxs(
|
|
96
|
+
"section",
|
|
97
|
+
{
|
|
98
|
+
id: surfaceId,
|
|
99
|
+
"data-floating-surface": true,
|
|
100
|
+
"data-floating-drag-handle": true,
|
|
101
|
+
"data-testid": "floating-assistant-surface",
|
|
102
|
+
"aria-label": `${identity.name} compact assistant`,
|
|
103
|
+
hidden: !expanded,
|
|
104
|
+
inert: !expanded,
|
|
105
|
+
className: `${expanded ? "flex animate-in fade-in duration-150 motion-reduce:animate-none" : "hidden"} absolute pointer-events-auto cursor-move flex-col overflow-hidden rounded-none border border-border/60 bg-card text-card-foreground shadow-lg [&_button:not([data-floating-drag-handle])]:cursor-pointer [&_button:disabled]:cursor-default [&_a]:cursor-pointer [&_textarea]:cursor-text [&_input]:cursor-text ${placement.up ? placement.left ? "[&_[data-testid=arbi-dm-composer]]:pr-16" : "[&_[data-testid=arbi-dm-composer]]:pl-16" : ""}`,
|
|
106
|
+
style: {
|
|
107
|
+
width: placement.width,
|
|
108
|
+
maxHeight: placement.height,
|
|
109
|
+
...placement.up ? { bottom: 0 } : { top: 0 },
|
|
110
|
+
...placement.left ? { right: 0 } : { left: 0 }
|
|
111
|
+
},
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ jsxs(
|
|
114
|
+
"button",
|
|
115
|
+
{
|
|
116
|
+
type: "button",
|
|
117
|
+
"data-floating-drag-handle": true,
|
|
118
|
+
"aria-label": `Move ${identity.name}`,
|
|
119
|
+
"aria-controls": surfaceId,
|
|
120
|
+
"aria-keyshortcuts": "ArrowUp ArrowDown ArrowLeft ArrowRight Home",
|
|
121
|
+
onClick: open,
|
|
122
|
+
title: "Drag to move \xB7 Arrow keys to position \xB7 Home to reset",
|
|
123
|
+
className: `shrink-0 cursor-move select-none touch-none flex items-center gap-2 px-4 py-3 text-left text-sm font-medium text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring ${!placement.up ? reserveLauncher : ""}`,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ jsx(ArbiBotHeadIcon, { className: "size-4 text-primary" }),
|
|
126
|
+
identity.name
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
/* @__PURE__ */ jsx("div", { className: "flex min-h-0 flex-1 flex-col", children })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
),
|
|
134
|
+
/* @__PURE__ */ jsxs(
|
|
135
|
+
"button",
|
|
136
|
+
{
|
|
137
|
+
type: "button",
|
|
138
|
+
"data-testid": "floating-assistant-launcher",
|
|
139
|
+
"data-floating-drag-handle": true,
|
|
140
|
+
"aria-label": `Open ${identity.name}`,
|
|
141
|
+
"aria-expanded": expanded,
|
|
142
|
+
"aria-controls": surfaceId,
|
|
143
|
+
title: `${identity.name} \xB7 Drag to move`,
|
|
144
|
+
onClick: open,
|
|
145
|
+
className: `absolute inset-0 z-10 flex size-12 cursor-move touch-none items-center justify-center rounded-full pointer-events-auto bg-primary text-primary-foreground hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${expanded ? "" : "shadow-md"}`,
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ jsx(ArbiBotHeadIcon, { className: "size-6" }),
|
|
148
|
+
identity.working && /* @__PURE__ */ jsx(
|
|
149
|
+
"span",
|
|
150
|
+
{
|
|
151
|
+
"aria-label": "Working",
|
|
152
|
+
className: "absolute right-0 top-0 size-2.5 animate-pulse rounded-full border-2 border-card bg-primary"
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
)
|
|
158
|
+
]
|
|
159
|
+
}
|
|
160
|
+
) });
|
|
161
|
+
}
|
|
162
|
+
export {
|
|
163
|
+
FloatingAssistantSurface
|
|
164
|
+
};
|
|
165
|
+
//# sourceMappingURL=FloatingAssistantSurface.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shell/FloatingAssistantSurface.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from 'react'\nimport { ArbiBotHeadIcon } from '@arbidocs/react/ui'\nimport { FloatingAssistantIdentity } from './floating-assistant-context'\n\n/** A persistent launcher and one compact surface; collapsing never discards the conversation. */\nexport function FloatingAssistantSurface({\n children,\n dragging,\n position,\n}: {\n children: React.ReactNode\n dragging: boolean\n position?: string\n}) {\n const root = useRef<HTMLDivElement>(null)\n const surfaceId = useId()\n const lastSize = useRef({ width: 400, height: 380 })\n const preferredDirection = useRef({ up: true, left: true })\n const wasDragging = useRef(false)\n const [identity, setIdentity] = useState({ name: 'Assistant', working: false })\n const updateIdentity = useCallback((name: string, working: boolean) => {\n setIdentity((old) => (old.name === name && old.working === working ? old : { name, working }))\n }, [])\n const [hovered, setHovered] = useState(false)\n const [focused, setFocused] = useState(false)\n const [expanded, setExpanded] = useState(false)\n const [placement, setPlacement] = useState({ up: true, left: true, width: 400, height: 380 })\n\n useLayoutEffect(() => {\n if (dragging) {\n wasDragging.current = true\n return\n }\n if (!root.current) return\n const dropped = wasDragging.current\n wasDragging.current = false\n const measure = () => {\n const box = root.current!.getBoundingClientRect()\n const boundary = root.current!.closest('[data-floating-boundary]')?.getBoundingClientRect()\n const top = (boundary?.top ?? 0) + 12\n const bottom = Math.min(window.innerHeight, boundary?.bottom ?? window.innerHeight) - 12\n const surface = root\n .current!.querySelector('[data-floating-surface]')\n ?.getBoundingClientRect()\n if (surface?.width && surface.height) lastSize.current = surface\n setPlacement(() => {\n const preferred = preferredDirection.current\n const keepHorizontal = preferred.left\n ? box.right - 12 >= lastSize.current.width\n : window.innerWidth - box.left - 12 >= lastSize.current.width\n const keepVertical = preferred.up\n ? box.bottom - top >= lastSize.current.height\n : bottom - box.top >= lastSize.current.height\n const up = keepVertical ? preferred.up : box.top >= (top + bottom) / 2\n const left = keepHorizontal ? preferred.left : box.left >= window.innerWidth / 2\n if (dropped) preferredDirection.current = { up, left }\n return {\n up,\n left,\n width: Math.min(400, left ? box.right - 12 : window.innerWidth - box.left - 12),\n height: Math.max(96, Math.min(380, up ? box.bottom - top : bottom - box.top)),\n }\n })\n }\n measure()\n window.addEventListener('resize', measure)\n return () => window.removeEventListener('resize', measure)\n }, [dragging, position, expanded])\n\n useEffect(() => {\n const surface = root.current!.querySelector<HTMLElement>('[data-floating-surface]')!\n const observer = new ResizeObserver(() => {\n const box = surface.getBoundingClientRect()\n if (box.width && box.height) lastSize.current = box\n })\n observer.observe(surface)\n return () => observer.disconnect()\n }, [])\n\n useEffect(() => {\n if (dragging) return\n const timer = setTimeout(() => setExpanded(hovered || focused), hovered || focused ? 80 : 350)\n return () => clearTimeout(timer)\n }, [hovered, focused, dragging])\n\n const open = () => {\n setExpanded(true)\n requestAnimationFrame(() => root.current?.querySelector('textarea')?.focus())\n }\n const reserveLauncher = placement.left ? 'pr-16' : 'pl-16'\n return (\n <FloatingAssistantIdentity.Provider value={updateIdentity}>\n <div\n ref={root}\n data-testid=\"floating-assistant\"\n data-expanded={expanded}\n className=\"relative size-12 pointer-events-none\"\n onPointerEnter={() => setHovered(true)}\n onPointerLeave={() => {\n setHovered(false)\n // A focused Send button can unmount while submitting without firing blur.\n // Retain React's logical focus for portaled menus outside this DOM subtree.\n if (\n !document.activeElement ||\n document.activeElement === document.body ||\n !document.activeElement.isConnected\n )\n setFocused(false)\n }}\n onFocusCapture={() => setFocused(true)}\n onBlurCapture={(event) => {\n if (!event.currentTarget.contains(event.relatedTarget)) setFocused(false)\n }}\n >\n <section\n id={surfaceId}\n data-floating-surface\n data-floating-drag-handle\n data-testid=\"floating-assistant-surface\"\n aria-label={`${identity.name} compact assistant`}\n hidden={!expanded}\n inert={!expanded}\n className={`${expanded ? 'flex animate-in fade-in duration-150 motion-reduce:animate-none' : 'hidden'} absolute pointer-events-auto cursor-move flex-col overflow-hidden rounded-none border border-border/60 bg-card text-card-foreground shadow-lg [&_button:not([data-floating-drag-handle])]:cursor-pointer [&_button:disabled]:cursor-default [&_a]:cursor-pointer [&_textarea]:cursor-text [&_input]:cursor-text ${placement.up ? (placement.left ? '[&_[data-testid=arbi-dm-composer]]:pr-16' : '[&_[data-testid=arbi-dm-composer]]:pl-16') : ''}`}\n style={{\n width: placement.width,\n maxHeight: placement.height,\n ...(placement.up ? { bottom: 0 } : { top: 0 }),\n ...(placement.left ? { right: 0 } : { left: 0 }),\n }}\n >\n <button\n type=\"button\"\n data-floating-drag-handle\n aria-label={`Move ${identity.name}`}\n aria-controls={surfaceId}\n aria-keyshortcuts=\"ArrowUp ArrowDown ArrowLeft ArrowRight Home\"\n onClick={open}\n title=\"Drag to move \u00B7 Arrow keys to position \u00B7 Home to reset\"\n className={`shrink-0 cursor-move select-none touch-none flex items-center gap-2 px-4 py-3 text-left text-sm font-medium text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring ${!placement.up ? reserveLauncher : ''}`}\n >\n <ArbiBotHeadIcon className=\"size-4 text-primary\" />\n {identity.name}\n </button>\n <div className=\"flex min-h-0 flex-1 flex-col\">{children}</div>\n </section>\n <button\n type=\"button\"\n data-testid=\"floating-assistant-launcher\"\n data-floating-drag-handle\n aria-label={`Open ${identity.name}`}\n aria-expanded={expanded}\n aria-controls={surfaceId}\n title={`${identity.name} \u00B7 Drag to move`}\n onClick={open}\n className={`absolute inset-0 z-10 flex size-12 cursor-move touch-none items-center justify-center rounded-full pointer-events-auto bg-primary text-primary-foreground hover:bg-primary/90 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 ${expanded ? '' : 'shadow-md'}`}\n >\n <ArbiBotHeadIcon className=\"size-6\" />\n {identity.working && (\n <span\n aria-label=\"Working\"\n className=\"absolute right-0 top-0 size-2.5 animate-pulse rounded-full border-2 border-card bg-primary\"\n />\n )}\n </button>\n </div>\n </FloatingAssistantIdentity.Provider>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAkIU,SAUE,KAVF;AAlIV,SAAS,aAAa,WAAW,OAAO,iBAAiB,QAAQ,gBAAgB;AACjF,SAAS,uBAAuB;AAChC,SAAS,iCAAiC;AAGnC,SAAS,yBAAyB;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AACF,GAIG;AACD,QAAM,OAAO,OAAuB,IAAI;AACxC,QAAM,YAAY,MAAM;AACxB,QAAM,WAAW,OAAO,EAAE,OAAO,KAAK,QAAQ,IAAI,CAAC;AACnD,QAAM,qBAAqB,OAAO,EAAE,IAAI,MAAM,MAAM,KAAK,CAAC;AAC1D,QAAM,cAAc,OAAO,KAAK;AAChC,QAAM,CAAC,UAAU,WAAW,IAAI,SAAS,EAAE,MAAM,aAAa,SAAS,MAAM,CAAC;AAC9E,QAAM,iBAAiB,YAAY,CAAC,MAAc,YAAqB;AACrE,gBAAY,CAAC,QAAS,IAAI,SAAS,QAAQ,IAAI,YAAY,UAAU,MAAM,EAAE,MAAM,QAAQ,CAAE;AAAA,EAC/F,GAAG,CAAC,CAAC;AACL,Q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AY;AAAA,YACZ,6BAAyB;AAAA,YACzB,cAAY,QAAQ,SAAS,IAAI;AAAA,YACjC,iBAAe;AAAA,YACf,iBAAe;AAAA,YACf,OAAO,GAAG,SAAS,IAAI;AAAA,YACvB,SAAS;AAAA,YACT,WAAW,uSAAuS,WAAW,KAAK,WAAW;AAAA,YAE7U;AAAA,kCAAC,mBAAgB,WAAU,UAAS;AAAA,cACnC,SAAS,WACR;AAAA,gBAAC;AAAA;AAAA,kBACC,cAAW;AAAA,kBACX,WAAU;AAAA;AAAA,cACZ;AAAA;AAAA;AAAA,QAEJ;AAAA;AAAA;AAAA,EACF,GACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PanelPortal Component
|
|
3
|
+
*
|
|
4
|
+
* Thin portal layer that renders children into the right target based on panel mode:
|
|
5
|
+
* - docked: portal to #dock-zone element
|
|
6
|
+
* - overlay: portal to <body> as a slide-out sheet over a backdrop
|
|
7
|
+
* - popout: portal to a separate browser window
|
|
8
|
+
* - main: portal to #main-zone element
|
|
9
|
+
*
|
|
10
|
+
* Manages popup window lifecycle for popout mode.
|
|
11
|
+
* Content-agnostic — just handles where things render.
|
|
12
|
+
*/
|
|
1
13
|
import type { FloatingPanelMode as PanelMode } from '../settings/FloatingPanel';
|
|
2
14
|
export interface PanelPortalProps {
|
|
3
15
|
panelId: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Move } from "lucide-react";
|
|
4
3
|
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
5
4
|
import { useFloatingDrag } from "./useFloatingDrag.js";
|
|
5
|
+
import { FloatingAssistantSurface } from "./FloatingAssistantSurface.js";
|
|
6
6
|
import { createPortal } from "react-dom";
|
|
7
7
|
import { DEFAULT_OVERLAY_ZONE_ID } from "./Shell.js";
|
|
8
8
|
import { usePanelHostSupport } from "./panel-host.js";
|
|
@@ -100,6 +100,7 @@ function OverlaySheet({
|
|
|
100
100
|
className: `${scoped ? "absolute inset-0" : "fixed inset-0"} ${floating ? "z-[45] pointer-events-none" : scoped ? "z-40" : "z-50"}`,
|
|
101
101
|
style: !floating && dockInset ? { right: dockInset } : void 0,
|
|
102
102
|
"data-testid": `${panelId}-overlay`,
|
|
103
|
+
"data-floating-boundary": floating || void 0,
|
|
103
104
|
children: [
|
|
104
105
|
floating && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
105
106
|
/* @__PURE__ */ jsx(
|
|
@@ -117,7 +118,7 @@ function OverlaySheet({
|
|
|
117
118
|
style: previewStyle,
|
|
118
119
|
"aria-hidden": "true",
|
|
119
120
|
"data-testid": `${panelId}-move-outline`,
|
|
120
|
-
className: "absolute z-50 pointer-events-none rounded-
|
|
121
|
+
className: "absolute z-50 pointer-events-none rounded-none border-2 border-dashed border-primary/80 bg-primary/[0.04] will-change-transform"
|
|
121
122
|
}
|
|
122
123
|
)
|
|
123
124
|
] }),
|
|
@@ -139,7 +140,8 @@ function OverlaySheet({
|
|
|
139
140
|
...floatingHandlers,
|
|
140
141
|
"data-dragging": isDragging || void 0,
|
|
141
142
|
style: floating ? {
|
|
142
|
-
width:
|
|
143
|
+
width: 48,
|
|
144
|
+
height: 48,
|
|
143
145
|
maxWidth: "calc(100% - 32px)",
|
|
144
146
|
maxHeight: "calc(100% - 32px)",
|
|
145
147
|
...floatingPosition
|
|
@@ -158,18 +160,7 @@ function OverlaySheet({
|
|
|
158
160
|
"data-testid": `${panelId}-overlay-resize-handle`
|
|
159
161
|
}
|
|
160
162
|
),
|
|
161
|
-
floating
|
|
162
|
-
"button",
|
|
163
|
-
{
|
|
164
|
-
type: "button",
|
|
165
|
-
"data-floating-drag-handle": true,
|
|
166
|
-
"aria-label": "Move conversation",
|
|
167
|
-
title: "Drag to move \xB7 Arrow keys to position \xB7 Home to reset",
|
|
168
|
-
className: "absolute -left-10 bottom-4 flex h-7 w-10 cursor-grab touch-none items-center justify-start rounded-full bg-transparent text-muted-foreground opacity-0 pointer-events-none transition-opacity duration-150 group-hover/floating:opacity-100 group-hover/floating:pointer-events-auto group-data-[dragging=true]/floating:opacity-100 focus-visible:opacity-100 focus-visible:pointer-events-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing",
|
|
169
|
-
children: /* @__PURE__ */ jsx("span", { className: "flex size-7 items-center justify-center rounded-full bg-card", children: /* @__PURE__ */ jsx(Move, { className: "size-3.5" }) })
|
|
170
|
-
}
|
|
171
|
-
),
|
|
172
|
-
children
|
|
163
|
+
floating ? /* @__PURE__ */ jsx(FloatingAssistantSurface, { dragging: isDragging, position: floatingPosition?.transform, children }) : children
|
|
173
164
|
]
|
|
174
165
|
}
|
|
175
166
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/shell/PanelPortal.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Move } from 'lucide-react'\n/**\n * PanelPortal Component\n *\n * Thin portal layer that renders children into the right target based on panel mode:\n * - docked: portal to #dock-zone element\n * - overlay: portal to <body> as a slide-out sheet over a backdrop\n * - popout: portal to a separate browser window\n * - main: portal to #main-zone element\n *\n * Manages popup window lifecycle for popout mode.\n * Content-agnostic \u2014 just handles where things render.\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport { useFloatingDrag } from './useFloatingDrag'\nimport { createPortal } from 'react-dom'\nimport { DEFAULT_OVERLAY_ZONE_ID } from './Shell'\nimport { usePanelHostSupport } from './panel-host'\nimport { PortalContainerProvider } from '@arbidocs/react/ui'\nimport type { FloatingPanelMode as PanelMode } from '../settings/FloatingPanel'\n\n// Overlay sheet sizing \u2014 defaults match the docked width (DEFAULT_DOCK_PX) so a\n// panel is the same size whether pinned or floating, and stays draggable here.\nconst OVERLAY_DEFAULT_PX = 544\nconst OVERLAY_MIN_PX = 360\n\nexport interface PanelPortalProps {\n panelId: string\n mode: PanelMode\n isOpen: boolean\n /** True while the overlay is animating out before unmounting. */\n isExiting?: boolean\n /** Called when popup window is closed externally (user closes the window) */\n onPopupClosed?: () => void\n /** Dismisses the panel \u2014 used by the overlay backdrop. */\n onClose?: () => void\n /** Window title for popout mode */\n popoutTitle?: string\n /** Initial overlay width in px (defaults to OVERLAY_DEFAULT_PX). */\n defaultWidth?: number\n floating?: boolean\n children: React.ReactNode\n}\n\n/**\n * Overlay sheet \u2014 a slide-out panel over the still-visible page, resizable by\n * dragging its left edge. Slides in on mount and out (via isExiting) before\n * unmounting, mirroring the left sidebar's animation.\n */\nfunction OverlaySheet({\n panelId,\n isExiting,\n onClose,\n defaultWidth,\n scoped,\n floating,\n children,\n}: {\n panelId: string\n isExiting?: boolean\n onClose?: () => void\n defaultWidth?: number\n /** Rendered inside the layout's overlay zone (below the topbar) rather than\n * over the whole viewport. */\n scoped?: boolean\n floating?: boolean\n children: React.ReactNode\n}) {\n const floatingDrag = useFloatingDrag(panelId, !!floating)\n const {\n style: floatingPosition,\n isDragging,\n previewRef,\n previewStyle,\n ...floatingHandlers\n } = floatingDrag\n const [width, setWidth] = useState(defaultWidth ?? OVERLAY_DEFAULT_PX)\n const [dockInset, setDockInset] = useState(0)\n useEffect(() => {\n if (!scoped || floating) return\n const dock = document.getElementById('dock-zone')\n const region = document.getElementById(DEFAULT_OVERLAY_ZONE_ID)?.parentElement\n if (!dock || !region) return\n // A host can retain a working conversation beside a temporary overlay. Keep both the\n // sheet and its backdrop within the main area so the conversation remains interactive.\n const measure = () => {\n const rect = dock.getBoundingClientRect()\n setDockInset(\n dock.childElementCount && rect.width > 0 && window.innerWidth > 640\n ? Math.max(0, region.getBoundingClientRect().right - rect.left)\n : 0\n )\n }\n measure()\n const sizes = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure)\n sizes?.observe(dock)\n sizes?.observe(region)\n window.addEventListener('resize', measure)\n const children = new MutationObserver(measure)\n children.observe(dock, { childList: true, attributes: true, attributeFilter: ['style'] })\n return () => {\n sizes?.disconnect()\n children.disconnect()\n window.removeEventListener('resize', measure)\n }\n }, [scoped, floating])\n const [isResizing, setIsResizing] = useState(false)\n // Live cursor position while dragging. The panel keeps its committed `width`\n // during the drag \u2014 only this thin preview line moves \u2014 so the heavy panel\n // content never reflows mid-drag (matching DockZone's split-screen handle).\n // The width is committed once on mouse-up.\n const [dragWidth, setDragWidth] = useState<number | null>(null)\n const dragWidthRef = useRef<number | null>(null)\n // Once the slide-in has played we drop the entry class, so later re-renders\n // don't restart the animation.\n const [hasEntered, setHasEntered] = useState(false)\n\n const handleResizeStart = useCallback((e: React.MouseEvent) => {\n e.preventDefault()\n setHasEntered(true)\n setIsResizing(true)\n setDragWidth(null)\n dragWidthRef.current = null\n }, [])\n\n useEffect(() => {\n if (!isResizing) return\n const handleMouseMove = (e: MouseEvent) => {\n // Anchored to the right edge \u2014 width grows as the cursor moves left.\n const max = window.innerWidth * 0.92\n const next = Math.min(\n Math.max(window.innerWidth - dockInset - e.clientX, OVERLAY_MIN_PX),\n max\n )\n dragWidthRef.current = next\n setDragWidth(next)\n }\n const handleMouseUp = () => {\n if (dragWidthRef.current !== null) setWidth(dragWidthRef.current)\n setIsResizing(false)\n setDragWidth(null)\n dragWidthRef.current = null\n }\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing, dockInset])\n\n return (\n // Scoped: absolute within the layout's overlay zone (below the topbar).\n // Unscoped fallback: fixed over the whole viewport, as before.\n <div\n // A floating conversation stays above a temporary sheet opened over it, and stays usable.\n className={`${scoped ? 'absolute inset-0' : 'fixed inset-0'} ${floating ? 'z-[45] pointer-events-none' : scoped ? 'z-40' : 'z-50'}`}\n // A compact conversation keeps its anchor when a document opens beside the page.\n style={!floating && dockInset ? { right: dockInset } : undefined}\n data-testid={`${panelId}-overlay`}\n >\n {floating && (\n <>\n <div\n aria-hidden=\"true\"\n data-testid={`${panelId}-move-backdrop`}\n className={`absolute inset-0 z-40 pointer-events-none bg-black/15 dark:bg-black/30 transition-opacity duration-150 motion-reduce:transition-none ${isDragging ? 'opacity-100' : 'opacity-0'}`}\n />\n {isDragging && (\n <div\n ref={previewRef}\n style={previewStyle}\n aria-hidden=\"true\"\n data-testid={`${panelId}-move-outline`}\n className=\"absolute z-50 pointer-events-none rounded-[26px] border-2 border-dashed border-primary/80 bg-primary/[0.04] will-change-transform\"\n />\n )}\n </>\n )}\n {/* In dark mode a 40% black veil crushes the light page text behind the sheet to\n mid-grey, so the veil is lighter there and the page stays readable underneath. */}\n <div\n className={`${floating ? 'hidden' : ''} absolute inset-0 bg-black/40 dark:bg-black/20 duration-200 ${\n // fill-mode-forwards holds the exit end-state \u2014 without it the\n // element snaps back fully visible for the frames between the\n // animation finishing and React unmounting it (a flicker).\n isExiting ? 'animate-out fade-out fill-mode-forwards' : 'animate-in fade-in'\n }`}\n onClick={onClose}\n aria-hidden=\"true\"\n data-testid={`${panelId}-overlay-backdrop`}\n />\n <div\n {...floatingHandlers}\n data-dragging={isDragging || undefined}\n style={\n floating\n ? {\n width: Math.min(width, 480),\n maxWidth: 'calc(100% - 32px)',\n maxHeight: 'calc(100% - 32px)',\n ...floatingPosition,\n }\n : { width, maxWidth: '100%' }\n }\n onAnimationEnd={() => !isExiting && setHasEntered(true)}\n className={`${floating ? 'group/floating absolute bottom-6 right-6 max-sm:bottom-3 max-sm:right-4 pointer-events-none flex flex-col transition-none' : 'absolute right-0 top-0 bottom-0 flex max-w-[92vw] flex-col border-l max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 border-border bg-muted shadow-2xl'} duration-200 ${\n isExiting\n ? 'animate-out slide-out-to-right fill-mode-forwards'\n : // Suppress the slide transform once entered so it doesn't replay.\n hasEntered || floating\n ? ''\n : 'animate-in slide-in-from-right'\n }`}\n >\n {/* Drag handle on the left edge to resize the sheet. */}\n <div\n className={`${floating ? 'hidden' : ''} absolute left-0 top-0 bottom-0 z-10 w-1.5 -translate-x-1/2 cursor-col-resize hover:bg-primary/40`}\n onMouseDown={handleResizeStart}\n data-testid={`${panelId}-overlay-resize-handle`}\n />\n {floating && (\n <button\n type=\"button\"\n data-floating-drag-handle\n aria-label=\"Move conversation\"\n title=\"Drag to move \u00B7 Arrow keys to position \u00B7 Home to reset\"\n className=\"absolute -left-10 bottom-4 flex h-7 w-10 cursor-grab touch-none items-center justify-start rounded-full bg-transparent text-muted-foreground opacity-0 pointer-events-none transition-opacity duration-150 group-hover/floating:opacity-100 group-hover/floating:pointer-events-auto group-data-[dragging=true]/floating:opacity-100 focus-visible:opacity-100 focus-visible:pointer-events-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring active:cursor-grabbing\"\n >\n <span className=\"flex size-7 items-center justify-center rounded-full bg-card\">\n <Move className=\"size-3.5\" />\n </span>\n </button>\n )}\n {children}\n </div>\n\n {/* Preview line \u2014 tracks the cursor during the drag; the panel resizes\n to this position only on release. */}\n {isResizing && dragWidth !== null && (\n <div\n className=\"absolute top-0 bottom-0 z-[60] w-0.5 bg-primary pointer-events-none\"\n style={{ right: dragWidth }}\n />\n )}\n {/* Transparent capture layer so the drag isn't interrupted by elements\n (iframes, the grid) swallowing pointer events. */}\n {isResizing && <div className=\"absolute inset-0 z-[55] cursor-col-resize\" />}\n </div>\n )\n}\n\nexport function PanelPortal({\n panelId,\n mode,\n isOpen,\n isExiting,\n onPopupClosed,\n onClose,\n popoutTitle,\n defaultWidth,\n floating = false,\n children,\n}: PanelPortalProps) {\n const { windows: windowManager } = usePanelHostSupport()\n // A shell can mount its zones in the same commit as an already-open panel.\n // Resolve again after that commit instead of relying on a later session update.\n const [portalTarget, setPortalTarget] = useState<HTMLElement | null>(null)\n useLayoutEffect(() => {\n const id =\n mode === 'overlay' ? DEFAULT_OVERLAY_ZONE_ID : mode === 'main' ? 'main-zone' : 'dock-zone'\n setPortalTarget(document.getElementById(id))\n }, [mode, isOpen])\n const [popupRoot, setPopupRoot] = useState<HTMLElement | null>(null)\n const popupWindowIdRef = useRef<string | null>(null)\n\n // Open popup window when switching to popout mode\n useEffect(() => {\n if (!isOpen || mode !== 'popout') {\n // Close popup if we're leaving popout mode (intentional mode switch, not user closing)\n if (popupWindowIdRef.current) {\n // Clear the onClose callback before closing so it doesn't trigger onPopupClosed\n windowManager.clearOnClose(popupWindowIdRef.current)\n windowManager.closeWindow(popupWindowIdRef.current)\n popupWindowIdRef.current = null\n setPopupRoot(null)\n }\n return\n }\n\n // Already have a popup open\n if (popupWindowIdRef.current) return\n\n const windowId = windowManager.createPopupWindow(\n `panel-${panelId}`,\n () => {\n popupWindowIdRef.current = null\n setPopupRoot(null)\n onPopupClosed?.()\n },\n popoutTitle || panelId\n )\n\n if (windowId) {\n const rootElement = windowManager.getRootElement(windowId)\n if (rootElement) {\n popupWindowIdRef.current = windowId\n setPopupRoot(rootElement)\n windowManager.getWindow(windowId)?.focus()\n }\n }\n }, [isOpen, mode, panelId, popoutTitle, onPopupClosed, windowManager])\n\n // Close the window on unmount, a moment later: a remount straight after (React's StrictMode\n // replays mount effects) keeps it instead. Closing it and opening another would need a second\n // click's permission to open a window, and the browser would block the new one as a pop-up.\n const pendingClose = useRef<ReturnType<typeof setTimeout> | null>(null)\n useEffect(() => {\n if (pendingClose.current) {\n clearTimeout(pendingClose.current)\n pendingClose.current = null\n }\n return () => {\n const windowId = popupWindowIdRef.current\n if (!windowId) return\n popupWindowIdRef.current = null\n pendingClose.current = setTimeout(() => {\n pendingClose.current = null\n // Taken up again by the remount (the open effect reuses a window that is still open).\n if (popupWindowIdRef.current === windowId) return\n windowManager.closeWindow(windowId)\n }, 0)\n }\n }, [windowManager])\n\n if (!isOpen && !isExiting) return null\n\n // Popout: render into popup window. Its dialogs and menus open there too, not in the window\n // behind it (where the Sign dialog used to open, out of sight).\n if (mode === 'popout' && popupRoot) {\n return createPortal(\n <PortalContainerProvider container={popupRoot}>{children}</PortalContainerProvider>,\n popupRoot\n )\n }\n\n // Overlay: a slide-out sheet over the still-visible page. Rendered into the\n // layout's #app-overlay-zone \u2014 the content region BELOW the app topbar \u2014 so\n // the bar stays visible and interactive above every overlay. Falls back to\n // <body> (viewport-covering) when no zone is mounted (e.g. embedded shells).\n if (mode === 'overlay') {\n const overlayZone = portalTarget\n return createPortal(\n <OverlaySheet\n panelId={panelId}\n isExiting={isExiting}\n onClose={onClose}\n defaultWidth={defaultWidth}\n scoped={overlayZone !== null}\n floating={floating}\n >\n {children}\n </OverlaySheet>,\n overlayZone ?? document.body\n )\n }\n\n // Main: render into main content zone\n if (mode === 'main') {\n const mainZone = portalTarget\n if (mainZone) {\n return createPortal(children, mainZone)\n }\n }\n\n // Docked: render into dock zone\n const dockZone = portalTarget\n if (dockZone) {\n return createPortal(children, dockZone)\n }\n\n // No target zone mounted yet \u2014 render nothing\n return null\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/**\n * PanelPortal Component\n *\n * Thin portal layer that renders children into the right target based on panel mode:\n * - docked: portal to #dock-zone element\n * - overlay: portal to <body> as a slide-out sheet over a backdrop\n * - popout: portal to a separate browser window\n * - main: portal to #main-zone element\n *\n * Manages popup window lifecycle for popout mode.\n * Content-agnostic \u2014 just handles where things render.\n */\n\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport { useFloatingDrag } from './useFloatingDrag'\nimport { FloatingAssistantSurface } from './FloatingAssistantSurface'\nimport { createPortal } from 'react-dom'\nimport { DEFAULT_OVERLAY_ZONE_ID } from './Shell'\nimport { usePanelHostSupport } from './panel-host'\nimport { PortalContainerProvider } from '@arbidocs/react/ui'\nimport type { FloatingPanelMode as PanelMode } from '../settings/FloatingPanel'\n\n// Overlay sheet sizing \u2014 defaults match the docked width (DEFAULT_DOCK_PX) so a\n// panel is the same size whether pinned or floating, and stays draggable here.\nconst OVERLAY_DEFAULT_PX = 544\nconst OVERLAY_MIN_PX = 360\n\nexport interface PanelPortalProps {\n panelId: string\n mode: PanelMode\n isOpen: boolean\n /** True while the overlay is animating out before unmounting. */\n isExiting?: boolean\n /** Called when popup window is closed externally (user closes the window) */\n onPopupClosed?: () => void\n /** Dismisses the panel \u2014 used by the overlay backdrop. */\n onClose?: () => void\n /** Window title for popout mode */\n popoutTitle?: string\n /** Initial overlay width in px (defaults to OVERLAY_DEFAULT_PX). */\n defaultWidth?: number\n floating?: boolean\n children: React.ReactNode\n}\n\n/**\n * Overlay sheet \u2014 a slide-out panel over the still-visible page, resizable by\n * dragging its left edge. Slides in on mount and out (via isExiting) before\n * unmounting, mirroring the left sidebar's animation.\n */\nfunction OverlaySheet({\n panelId,\n isExiting,\n onClose,\n defaultWidth,\n scoped,\n floating,\n children,\n}: {\n panelId: string\n isExiting?: boolean\n onClose?: () => void\n defaultWidth?: number\n /** Rendered inside the layout's overlay zone (below the topbar) rather than\n * over the whole viewport. */\n scoped?: boolean\n floating?: boolean\n children: React.ReactNode\n}) {\n const floatingDrag = useFloatingDrag(panelId, !!floating)\n const {\n style: floatingPosition,\n isDragging,\n previewRef,\n previewStyle,\n ...floatingHandlers\n } = floatingDrag\n const [width, setWidth] = useState(defaultWidth ?? OVERLAY_DEFAULT_PX)\n const [dockInset, setDockInset] = useState(0)\n useEffect(() => {\n if (!scoped || floating) return\n const dock = document.getElementById('dock-zone')\n const region = document.getElementById(DEFAULT_OVERLAY_ZONE_ID)?.parentElement\n if (!dock || !region) return\n // A host can retain a working conversation beside a temporary overlay. Keep both the\n // sheet and its backdrop within the main area so the conversation remains interactive.\n const measure = () => {\n const rect = dock.getBoundingClientRect()\n setDockInset(\n dock.childElementCount && rect.width > 0 && window.innerWidth > 640\n ? Math.max(0, region.getBoundingClientRect().right - rect.left)\n : 0\n )\n }\n measure()\n const sizes = typeof ResizeObserver === 'undefined' ? null : new ResizeObserver(measure)\n sizes?.observe(dock)\n sizes?.observe(region)\n window.addEventListener('resize', measure)\n const children = new MutationObserver(measure)\n children.observe(dock, { childList: true, attributes: true, attributeFilter: ['style'] })\n return () => {\n sizes?.disconnect()\n children.disconnect()\n window.removeEventListener('resize', measure)\n }\n }, [scoped, floating])\n const [isResizing, setIsResizing] = useState(false)\n // Live cursor position while dragging. The panel keeps its committed `width`\n // during the drag \u2014 only this thin preview line moves \u2014 so the heavy panel\n // content never reflows mid-drag (matching DockZone's split-screen handle).\n // The width is committed once on mouse-up.\n const [dragWidth, setDragWidth] = useState<number | null>(null)\n const dragWidthRef = useRef<number | null>(null)\n // Once the slide-in has played we drop the entry class, so later re-renders\n // don't restart the animation.\n const [hasEntered, setHasEntered] = useState(false)\n\n const handleResizeStart = useCallback((e: React.MouseEvent) => {\n e.preventDefault()\n setHasEntered(true)\n setIsResizing(true)\n setDragWidth(null)\n dragWidthRef.current = null\n }, [])\n\n useEffect(() => {\n if (!isResizing) return\n const handleMouseMove = (e: MouseEvent) => {\n // Anchored to the right edge \u2014 width grows as the cursor moves left.\n const max = window.innerWidth * 0.92\n const next = Math.min(\n Math.max(window.innerWidth - dockInset - e.clientX, OVERLAY_MIN_PX),\n max\n )\n dragWidthRef.current = next\n setDragWidth(next)\n }\n const handleMouseUp = () => {\n if (dragWidthRef.current !== null) setWidth(dragWidthRef.current)\n setIsResizing(false)\n setDragWidth(null)\n dragWidthRef.current = null\n }\n document.addEventListener('mousemove', handleMouseMove)\n document.addEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = 'col-resize'\n document.body.style.userSelect = 'none'\n return () => {\n document.removeEventListener('mousemove', handleMouseMove)\n document.removeEventListener('mouseup', handleMouseUp)\n document.body.style.cursor = ''\n document.body.style.userSelect = ''\n }\n }, [isResizing, dockInset])\n\n return (\n // Scoped: absolute within the layout's overlay zone (below the topbar).\n // Unscoped fallback: fixed over the whole viewport, as before.\n <div\n // A floating conversation stays above a temporary sheet opened over it, and stays usable.\n className={`${scoped ? 'absolute inset-0' : 'fixed inset-0'} ${floating ? 'z-[45] pointer-events-none' : scoped ? 'z-40' : 'z-50'}`}\n // A compact conversation keeps its anchor when a document opens beside the page.\n style={!floating && dockInset ? { right: dockInset } : undefined}\n data-testid={`${panelId}-overlay`}\n data-floating-boundary={floating || undefined}\n >\n {floating && (\n <>\n <div\n aria-hidden=\"true\"\n data-testid={`${panelId}-move-backdrop`}\n className={`absolute inset-0 z-40 pointer-events-none bg-black/15 dark:bg-black/30 transition-opacity duration-150 motion-reduce:transition-none ${isDragging ? 'opacity-100' : 'opacity-0'}`}\n />\n {isDragging && (\n <div\n ref={previewRef}\n style={previewStyle}\n aria-hidden=\"true\"\n data-testid={`${panelId}-move-outline`}\n className=\"absolute z-50 pointer-events-none rounded-none border-2 border-dashed border-primary/80 bg-primary/[0.04] will-change-transform\"\n />\n )}\n </>\n )}\n {/* In dark mode a 40% black veil crushes the light page text behind the sheet to\n mid-grey, so the veil is lighter there and the page stays readable underneath. */}\n <div\n className={`${floating ? 'hidden' : ''} absolute inset-0 bg-black/40 dark:bg-black/20 duration-200 ${\n // fill-mode-forwards holds the exit end-state \u2014 without it the\n // element snaps back fully visible for the frames between the\n // animation finishing and React unmounting it (a flicker).\n isExiting ? 'animate-out fade-out fill-mode-forwards' : 'animate-in fade-in'\n }`}\n onClick={onClose}\n aria-hidden=\"true\"\n data-testid={`${panelId}-overlay-backdrop`}\n />\n <div\n {...floatingHandlers}\n data-dragging={isDragging || undefined}\n style={\n floating\n ? {\n width: 48,\n height: 48,\n maxWidth: 'calc(100% - 32px)',\n maxHeight: 'calc(100% - 32px)',\n ...floatingPosition,\n }\n : { width, maxWidth: '100%' }\n }\n onAnimationEnd={() => !isExiting && setHasEntered(true)}\n className={`${floating ? 'group/floating absolute bottom-6 right-6 max-sm:bottom-3 max-sm:right-4 pointer-events-none flex flex-col transition-none' : 'absolute right-0 top-0 bottom-0 flex max-w-[92vw] flex-col border-l max-sm:!w-full max-sm:!max-w-full max-sm:border-l-0 border-border bg-muted shadow-2xl'} duration-200 ${\n isExiting\n ? 'animate-out slide-out-to-right fill-mode-forwards'\n : // Suppress the slide transform once entered so it doesn't replay.\n hasEntered || floating\n ? ''\n : 'animate-in slide-in-from-right'\n }`}\n >\n {/* Drag handle on the left edge to resize the sheet. */}\n <div\n className={`${floating ? 'hidden' : ''} absolute left-0 top-0 bottom-0 z-10 w-1.5 -translate-x-1/2 cursor-col-resize hover:bg-primary/40`}\n onMouseDown={handleResizeStart}\n data-testid={`${panelId}-overlay-resize-handle`}\n />\n {floating ? (\n <FloatingAssistantSurface dragging={isDragging} position={floatingPosition?.transform}>\n {children}\n </FloatingAssistantSurface>\n ) : (\n children\n )}\n </div>\n\n {/* Preview line \u2014 tracks the cursor during the drag; the panel resizes\n to this position only on release. */}\n {isResizing && dragWidth !== null && (\n <div\n className=\"absolute top-0 bottom-0 z-[60] w-0.5 bg-primary pointer-events-none\"\n style={{ right: dragWidth }}\n />\n )}\n {/* Transparent capture layer so the drag isn't interrupted by elements\n (iframes, the grid) swallowing pointer events. */}\n {isResizing && <div className=\"absolute inset-0 z-[55] cursor-col-resize\" />}\n </div>\n )\n}\n\nexport function PanelPortal({\n panelId,\n mode,\n isOpen,\n isExiting,\n onPopupClosed,\n onClose,\n popoutTitle,\n defaultWidth,\n floating = false,\n children,\n}: PanelPortalProps) {\n const { windows: windowManager } = usePanelHostSupport()\n // A shell can mount its zones in the same commit as an already-open panel.\n // Resolve again after that commit instead of relying on a later session update.\n const [portalTarget, setPortalTarget] = useState<HTMLElement | null>(null)\n useLayoutEffect(() => {\n const id =\n mode === 'overlay' ? DEFAULT_OVERLAY_ZONE_ID : mode === 'main' ? 'main-zone' : 'dock-zone'\n setPortalTarget(document.getElementById(id))\n }, [mode, isOpen])\n const [popupRoot, setPopupRoot] = useState<HTMLElement | null>(null)\n const popupWindowIdRef = useRef<string | null>(null)\n\n // Open popup window when switching to popout mode\n useEffect(() => {\n if (!isOpen || mode !== 'popout') {\n // Close popup if we're leaving popout mode (intentional mode switch, not user closing)\n if (popupWindowIdRef.current) {\n // Clear the onClose callback before closing so it doesn't trigger onPopupClosed\n windowManager.clearOnClose(popupWindowIdRef.current)\n windowManager.closeWindow(popupWindowIdRef.current)\n popupWindowIdRef.current = null\n setPopupRoot(null)\n }\n return\n }\n\n // Already have a popup open\n if (popupWindowIdRef.current) return\n\n const windowId = windowManager.createPopupWindow(\n `panel-${panelId}`,\n () => {\n popupWindowIdRef.current = null\n setPopupRoot(null)\n onPopupClosed?.()\n },\n popoutTitle || panelId\n )\n\n if (windowId) {\n const rootElement = windowManager.getRootElement(windowId)\n if (rootElement) {\n popupWindowIdRef.current = windowId\n setPopupRoot(rootElement)\n windowManager.getWindow(windowId)?.focus()\n }\n }\n }, [isOpen, mode, panelId, popoutTitle, onPopupClosed, windowManager])\n\n // Close the window on unmount, a moment later: a remount straight after (React's StrictMode\n // replays mount effects) keeps it instead. Closing it and opening another would need a second\n // click's permission to open a window, and the browser would block the new one as a pop-up.\n const pendingClose = useRef<ReturnType<typeof setTimeout> | null>(null)\n useEffect(() => {\n if (pendingClose.current) {\n clearTimeout(pendingClose.current)\n pendingClose.current = null\n }\n return () => {\n const windowId = popupWindowIdRef.current\n if (!windowId) return\n popupWindowIdRef.current = null\n pendingClose.current = setTimeout(() => {\n pendingClose.current = null\n // Taken up again by the remount (the open effect reuses a window that is still open).\n if (popupWindowIdRef.current === windowId) return\n windowManager.closeWindow(windowId)\n }, 0)\n }\n }, [windowManager])\n\n if (!isOpen && !isExiting) return null\n\n // Popout: render into popup window. Its dialogs and menus open there too, not in the window\n // behind it (where the Sign dialog used to open, out of sight).\n if (mode === 'popout' && popupRoot) {\n return createPortal(\n <PortalContainerProvider container={popupRoot}>{children}</PortalContainerProvider>,\n popupRoot\n )\n }\n\n // Overlay: a slide-out sheet over the still-visible page. Rendered into the\n // layout's #app-overlay-zone \u2014 the content region BELOW the app topbar \u2014 so\n // the bar stays visible and interactive above every overlay. Falls back to\n // <body> (viewport-covering) when no zone is mounted (e.g. embedded shells).\n if (mode === 'overlay') {\n const overlayZone = portalTarget\n return createPortal(\n <OverlaySheet\n panelId={panelId}\n isExiting={isExiting}\n onClose={onClose}\n defaultWidth={defaultWidth}\n scoped={overlayZone !== null}\n floating={floating}\n >\n {children}\n </OverlaySheet>,\n overlayZone ?? document.body\n )\n }\n\n // Main: render into main content zone\n if (mode === 'main') {\n const mainZone = portalTarget\n if (mainZone) {\n return createPortal(children, mainZone)\n }\n }\n\n // Docked: render into dock zone\n const dockZone = portalTarget\n if (dockZone) {\n return createPortal(children, dockZone)\n }\n\n // No target zone mounted yet \u2014 render nothing\n return null\n}\n"],
|
|
5
|
+
"mappings": ";AAwKQ,mBACE,KADF;AA3JR,SAAS,aAAa,WAAW,iBAAiB,QAAQ,gBAAgB;AAC1E,SAAS,uBAAuB;AAChC,SAAS,gCAAgC;AACzC,SAAS,oBAAoB;AAC7B,SAAS,+BAA+B;AACxC,SAAS,2BAA2B;AACpC,SAAS,+BAA+B;AAKxC,MAAM,qBAAqB;AAC3B,MAAM,iBAAiB;AAyBvB,SAAS,aAAa;AAAA,EACpB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAUG;AACD,QAAM,eAAe,gBAAgB,SAAS,CAAC,CAAC,QAAQ;AACxD,QAAM;AAAA,IACJ,OAAO;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI;AACJ,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,gBAAgB,kBAAkB;AACrE,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,CAAC;AAC5C,YAAU,MAAM;AACd,QAAI,CAAC,UAAU,SAAU;AACzB,UAAM,OAAO,SAAS,eAAe,WAAW;AAChD,UAAM,SAAS,SAAS,eAAe,uBAAuB,GAAG;AACjE,QAAI,CAAC,QA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,UAAU,CAAC,UAAW,QAAO;AAIlC,MAAI,SAAS,YAAY,WAAW;AAClC,WAAO;AAAA,MACL,oBAAC,2BAAwB,WAAW,WAAY,UAAS;AAAA,MACzD;AAAA,IACF;AAAA,EACF;AAMA,MAAI,SAAS,WAAW;AACtB,UAAM,cAAc;AACpB,WAAO;AAAA,MACL;AAAA,QAAC;AAAA;AAAA,UACC;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA,QAAQ,gBAAgB;AAAA,UACxB;AAAA,UAEC;AAAA;AAAA,MACH;AAAA,MACA,eAAe,SAAS;AAAA,IAC1B;AAAA,EACF;AAGA,MAAI,SAAS,QAAQ;AACnB,UAAM,WAAW;AACjB,QAAI,UAAU;AACZ,aAAO,aAAa,UAAU,QAAQ;AAAA,IACxC;AAAA,EACF;AAGA,QAAM,WAAW;AACjB,MAAI,UAAU;AACZ,WAAO,aAAa,UAAU,QAAQ;AAAA,EACxC;AAGA,SAAO;AACT;",
|
|
6
6
|
"names": ["children"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/shell/floating-assistant-context.ts"],
|
|
4
|
+
"sourcesContent": ["import { createContext } from 'react'\n\n/** The chat supplies identity and activity; the compact shell owns presentation. */\nexport const FloatingAssistantIdentity = createContext<\n ((name: string, working: boolean) => void) | null\n>(null)\n"],
|
|
5
|
+
"mappings": ";AAAA,SAAS,qBAAqB;AAGvB,MAAM,4BAA4B,cAEvC,IAAI;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|