@arbidocs/blocks 0.5.143 → 0.5.144

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.
Files changed (109) hide show
  1. package/dist/{ConnectedCallDock-JVLJEWLJ.cjs → ConnectedCallDock-FHKM7MAL.cjs} +21 -21
  2. package/dist/{ConnectedCallDock-JVLJEWLJ.cjs.map → ConnectedCallDock-FHKM7MAL.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-7YQRDIS3.cjs → ConnectedCallRoom-QNMZJMLB.cjs} +14 -14
  4. package/dist/{ConnectedCallRoom-7YQRDIS3.cjs.map → ConnectedCallRoom-QNMZJMLB.cjs.map} +1 -1
  5. package/dist/{ConnectedNativeDocxComparison-FWUYOTSF.cjs → ConnectedNativeDocxComparison-SWY7327V.cjs} +15 -15
  6. package/dist/{ConnectedNativeDocxComparison-FWUYOTSF.cjs.map → ConnectedNativeDocxComparison-SWY7327V.cjs.map} +1 -1
  7. package/dist/{ConnectedPresentation-JJXQBIV2.cjs → ConnectedPresentation-XPMQQ3E2.cjs} +16 -16
  8. package/dist/{ConnectedPresentation-JJXQBIV2.cjs.map → ConnectedPresentation-XPMQQ3E2.cjs.map} +1 -1
  9. package/dist/{ConnectedProductionSetDialog-EOWZQ6J3.cjs → ConnectedProductionSetDialog-GM5D7IUG.cjs} +3 -3
  10. package/dist/{ConnectedProductionSetDialog-EOWZQ6J3.cjs.map → ConnectedProductionSetDialog-GM5D7IUG.cjs.map} +1 -1
  11. package/dist/{ConnectedSlidesTab-BLR762KY.cjs → ConnectedSlidesTab-OOTWJBDV.cjs} +14 -14
  12. package/dist/{ConnectedSlidesTab-BLR762KY.cjs.map → ConnectedSlidesTab-OOTWJBDV.cjs.map} +1 -1
  13. package/dist/{ConnectedStreamedWordArtifact-LXXTFGIW.cjs → ConnectedStreamedWordArtifact-TU5GEHEV.cjs} +15 -15
  14. package/dist/{ConnectedStreamedWordArtifact-LXXTFGIW.cjs.map → ConnectedStreamedWordArtifact-TU5GEHEV.cjs.map} +1 -1
  15. package/dist/{DocumentReviewCard-ENCPTGJE.cjs → DocumentReviewCard-BCWIW7PU.cjs} +15 -15
  16. package/dist/{DocumentReviewCard-ENCPTGJE.cjs.map → DocumentReviewCard-BCWIW7PU.cjs.map} +1 -1
  17. package/dist/{FilesViewerDialog-VOCAK22P.cjs → FilesViewerDialog-UX7LNBJI.cjs} +44 -44
  18. package/dist/{FilesViewerDialog-VOCAK22P.cjs.map → FilesViewerDialog-UX7LNBJI.cjs.map} +1 -1
  19. package/dist/{WorkspaceTableView-2RH33X3U.cjs → WorkspaceTableView-NW3ANGBX.cjs} +8 -8
  20. package/dist/{WorkspaceTableView-2RH33X3U.cjs.map → WorkspaceTableView-NW3ANGBX.cjs.map} +1 -1
  21. package/dist/agents/index.cjs +296 -296
  22. package/dist/{ai-YX3OAC4F.cjs → ai-T2BDBHI3.cjs} +25 -25
  23. package/dist/ai-T2BDBHI3.cjs.map +1 -0
  24. package/dist/calls/index.cjs +121 -121
  25. package/dist/chat/index.cjs +1 -1
  26. package/dist/{chunk-YST6GVN5.cjs → chunk-2Q32RXY2.cjs} +3 -3
  27. package/dist/{chunk-YST6GVN5.cjs.map → chunk-2Q32RXY2.cjs.map} +1 -1
  28. package/dist/{chunk-VCDD763Y.cjs → chunk-7HU2NQVO.cjs} +3 -3
  29. package/dist/{chunk-VCDD763Y.cjs.map → chunk-7HU2NQVO.cjs.map} +1 -1
  30. package/dist/{chunk-Z6FJLJWX.cjs → chunk-7KEB3VZ5.cjs} +4 -4
  31. package/dist/{chunk-Z6FJLJWX.cjs.map → chunk-7KEB3VZ5.cjs.map} +1 -1
  32. package/dist/{chunk-36YSDDHB.cjs → chunk-AJTHOVCM.cjs} +64 -64
  33. package/dist/{chunk-36YSDDHB.cjs.map → chunk-AJTHOVCM.cjs.map} +1 -1
  34. package/dist/{chunk-3RN64MXC.cjs → chunk-ANFDJIJP.cjs} +4 -4
  35. package/dist/{chunk-3RN64MXC.cjs.map → chunk-ANFDJIJP.cjs.map} +1 -1
  36. package/dist/{chunk-YZ25NAR3.cjs → chunk-BSZ45U3F.cjs} +3 -3
  37. package/dist/{chunk-YZ25NAR3.cjs.map → chunk-BSZ45U3F.cjs.map} +1 -1
  38. package/dist/{chunk-KP7BQIZL.cjs → chunk-BT2QTDZ4.cjs} +35 -35
  39. package/dist/{chunk-KP7BQIZL.cjs.map → chunk-BT2QTDZ4.cjs.map} +1 -1
  40. package/dist/{chunk-FSGMWE5I.cjs → chunk-BXLY2UQM.cjs} +4 -4
  41. package/dist/{chunk-FSGMWE5I.cjs.map → chunk-BXLY2UQM.cjs.map} +1 -1
  42. package/dist/{chunk-QW6NCUR7.cjs → chunk-DH5NOQCU.cjs} +5 -5
  43. package/dist/{chunk-QW6NCUR7.cjs.map → chunk-DH5NOQCU.cjs.map} +1 -1
  44. package/dist/{chunk-IFJBE7M5.cjs → chunk-EY23TOPI.cjs} +11 -11
  45. package/dist/{chunk-IFJBE7M5.cjs.map → chunk-EY23TOPI.cjs.map} +1 -1
  46. package/dist/{chunk-2XZ3HBAA.cjs → chunk-F47B75LV.cjs} +12 -12
  47. package/dist/{chunk-2XZ3HBAA.cjs.map → chunk-F47B75LV.cjs.map} +1 -1
  48. package/dist/{chunk-NPRNR54M.cjs → chunk-F7IBUDD5.cjs} +6 -6
  49. package/dist/{chunk-NPRNR54M.cjs.map → chunk-F7IBUDD5.cjs.map} +1 -1
  50. package/dist/{chunk-UKAN76CS.cjs → chunk-FM46VQ5D.cjs} +26 -26
  51. package/dist/{chunk-UKAN76CS.cjs.map → chunk-FM46VQ5D.cjs.map} +1 -1
  52. package/dist/{chunk-73ECBDG7.cjs → chunk-FWD4WSGR.cjs} +3 -3
  53. package/dist/{chunk-73ECBDG7.cjs.map → chunk-FWD4WSGR.cjs.map} +1 -1
  54. package/dist/{chunk-33GOYI3O.cjs → chunk-FYNNNQ6H.cjs} +4 -4
  55. package/dist/{chunk-33GOYI3O.cjs.map → chunk-FYNNNQ6H.cjs.map} +1 -1
  56. package/dist/{chunk-VF26CUE3.cjs → chunk-HG72AVXX.cjs} +3 -3
  57. package/dist/{chunk-VF26CUE3.cjs.map → chunk-HG72AVXX.cjs.map} +1 -1
  58. package/dist/{chunk-YOSRBLLD.cjs → chunk-JDQIZFDO.cjs} +7 -7
  59. package/dist/{chunk-YOSRBLLD.cjs.map → chunk-JDQIZFDO.cjs.map} +1 -1
  60. package/dist/{chunk-GF3I3SA4.cjs → chunk-JXSSR6T3.cjs} +7 -7
  61. package/dist/{chunk-GF3I3SA4.cjs.map → chunk-JXSSR6T3.cjs.map} +1 -1
  62. package/dist/{chunk-MBXXWTKT.cjs → chunk-JXZM5ODS.cjs} +28 -28
  63. package/dist/{chunk-MBXXWTKT.cjs.map → chunk-JXZM5ODS.cjs.map} +1 -1
  64. package/dist/{chunk-UD56Y6UA.cjs → chunk-LYDPVFNS.cjs} +4 -4
  65. package/dist/{chunk-UD56Y6UA.cjs.map → chunk-LYDPVFNS.cjs.map} +1 -1
  66. package/dist/{chunk-ECSOXKJQ.cjs → chunk-N5UI363Q.cjs} +3 -3
  67. package/dist/{chunk-ECSOXKJQ.cjs.map → chunk-N5UI363Q.cjs.map} +1 -1
  68. package/dist/{chunk-ZPIZINH2.cjs → chunk-N7B5OAI5.cjs} +4 -4
  69. package/dist/{chunk-ZPIZINH2.cjs.map → chunk-N7B5OAI5.cjs.map} +1 -1
  70. package/dist/{chunk-MC34TXSS.cjs → chunk-NM2WDBXH.cjs} +13 -13
  71. package/dist/{chunk-MC34TXSS.cjs.map → chunk-NM2WDBXH.cjs.map} +1 -1
  72. package/dist/{chunk-N3H3YAKY.cjs → chunk-PQQA34ZR.cjs} +4 -4
  73. package/dist/{chunk-N3H3YAKY.cjs.map → chunk-PQQA34ZR.cjs.map} +1 -1
  74. package/dist/{chunk-FK7MBD5H.cjs → chunk-PWGHCEJK.cjs} +6 -6
  75. package/dist/{chunk-FK7MBD5H.cjs.map → chunk-PWGHCEJK.cjs.map} +1 -1
  76. package/dist/{chunk-P2AZ2HX7.cjs → chunk-Q67V6O4R.cjs} +76 -76
  77. package/dist/{chunk-P2AZ2HX7.cjs.map → chunk-Q67V6O4R.cjs.map} +1 -1
  78. package/dist/{chunk-EYXU32D7.cjs → chunk-Q77OKXYM.cjs} +6 -6
  79. package/dist/{chunk-EYXU32D7.cjs.map → chunk-Q77OKXYM.cjs.map} +1 -1
  80. package/dist/{chunk-U6XMZG6G.cjs → chunk-RDBUQCAS.cjs} +3 -3
  81. package/dist/{chunk-U6XMZG6G.cjs.map → chunk-RDBUQCAS.cjs.map} +1 -1
  82. package/dist/{chunk-JJZOL5MG.cjs → chunk-RYVZDFVO.cjs} +3 -3
  83. package/dist/{chunk-JJZOL5MG.cjs.map → chunk-RYVZDFVO.cjs.map} +1 -1
  84. package/dist/{chunk-PI4U4LEN.cjs → chunk-SDSK7RWP.cjs} +10 -10
  85. package/dist/{chunk-PI4U4LEN.cjs.map → chunk-SDSK7RWP.cjs.map} +1 -1
  86. package/dist/{chunk-OE36OY64.cjs → chunk-SJTLHWFC.cjs} +15 -15
  87. package/dist/{chunk-OE36OY64.cjs.map → chunk-SJTLHWFC.cjs.map} +1 -1
  88. package/dist/{chunk-SK6LFIU2.cjs → chunk-TIBTTITZ.cjs} +3 -3
  89. package/dist/{chunk-SK6LFIU2.cjs.map → chunk-TIBTTITZ.cjs.map} +1 -1
  90. package/dist/{chunk-JJDJLAC7.cjs → chunk-YQRACWAS.cjs} +48 -48
  91. package/dist/{chunk-JJDJLAC7.cjs.map → chunk-YQRACWAS.cjs.map} +1 -1
  92. package/dist/{chunk-6NHOZTIY.cjs → chunk-ZCSX5SMV.cjs} +50 -50
  93. package/dist/{chunk-6NHOZTIY.cjs.map → chunk-ZCSX5SMV.cjs.map} +1 -1
  94. package/dist/{chunk-2VEQKLNN.cjs → chunk-ZJS2BM7D.cjs} +6 -6
  95. package/dist/{chunk-2VEQKLNN.cjs.map → chunk-ZJS2BM7D.cjs.map} +1 -1
  96. package/dist/connect/docx.cjs +18 -18
  97. package/dist/connect/index.cjs +993 -993
  98. package/dist/connect/viewer.cjs +32 -32
  99. package/dist/dashboards/index.cjs +1 -1
  100. package/dist/embed/index.cjs +38 -38
  101. package/dist/files/index.cjs +224 -224
  102. package/dist/index.cjs +1730 -1730
  103. package/dist/settings/index.cjs +146 -146
  104. package/dist/shell/index.cjs +87 -87
  105. package/dist/studio/index.cjs +28 -28
  106. package/dist/workflow-canvas/index.cjs +52 -52
  107. package/node_modules/@arbidocs/coedit/package.json +1 -1
  108. package/package.json +5 -5
  109. package/dist/ai-YX3OAC4F.cjs.map +0 -1
@@ -2,8 +2,8 @@
2
2
  'use strict';
3
3
 
4
4
  var chunk7D4WXUBS_cjs = require('./chunk-7D4WXUBS.cjs');
5
- var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
6
5
  var chunkXPQR2PJX_cjs = require('./chunk-XPQR2PJX.cjs');
6
+ var chunk3YZKDCWY_cjs = require('./chunk-3YZKDCWY.cjs');
7
7
  var chunkLIKDQBNJ_cjs = require('./chunk-LIKDQBNJ.cjs');
8
8
  var react = require('@arbidocs/react');
9
9
  var ui = require('@arbidocs/react/ui');
@@ -189,5 +189,5 @@ exports.useUsableSkillListings = useUsableSkillListings;
189
189
  exports.useWorkflowDefinitions = useWorkflowDefinitions;
190
190
  exports.useWorkflowTasks = useWorkflowTasks;
191
191
  exports.withoutMarketplace = withoutMarketplace;
192
- //# sourceMappingURL=chunk-YST6GVN5.cjs.map
193
- //# sourceMappingURL=chunk-YST6GVN5.cjs.map
192
+ //# sourceMappingURL=chunk-2Q32RXY2.cjs.map
193
+ //# sourceMappingURL=chunk-2Q32RXY2.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/workflows/useWorkflowTasks.ts","../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts"],"names":["useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","useMemo","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate","useArbiSession","useUserSettings","useHost","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK"],"mappings":";;;;;;;;;;;AAuDO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,cAAcA,oBAAA,EAAe;AACnC,EAAA,MAAM,aAAaC,uBAAA,EAAkB;AACrC,EAAA,MAAM,iBAAiBC,uBAAA,EAAkB;AACzC,EAAA,MAAM,qBAAqBC,2BAAA,EAAsB;AACjD,EAAA,MAAM,yBAAyBC,uBAAA,EAAkB;AACjD,EAAA,MAAM,iBAAA,GAAoBC,yBAAA,CAAoB,CAAC,CAAA,KAAM,EAAE,WAAW,CAAA;AAClE,EAAA,MAAM,UAAA,GAAaC,mBAAA,CAAc,EAAE,WAAA,EAAa,mBAAmB,CAAA;AACnE,EAAA,MAAM,EAAE,SAAA,EAAU,GAAIC,sCAAA,EAAqB;AAI3C,EAAA,MAAM,EAAE,WAAA,EAAa,KAAA,EAAM,GAAIC,yBAAA,EAAoB;AACnD,EAAA,MAAM,gBAAA,GAAmBC,mBAAA;AAAA,IACvB,CAAC,YAAoB,WAAA,KACnB,KAAA,CAAM,EAAE,UAAA,EAAY,WAAA,EAAa,CAAA,CAAE,IAAA;AAAA,MACjC,MAAM,MAAA;AAAA,MACN,MAAM;AAAA,KACR;AAAA,IACF,CAAC,KAAK;AAAA,GACR;AAEA,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,GAAY,EAAC,KAAMC,kBAAA,EAAa;AAC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AAC,CAAA,KAAM,CAAC,SAAA,CAAU,GAAA,CAAI,CAAA,CAAE,EAAE,CAAC,CAAA;AAAA,MACtC;AAAA,KACF;AAEA,IAAA,MAAM,MAAM,CAAC,GAAG,UAAU,GAAG,UAAA,EAAY,GAAG,UAAU,CAAA;AACtD,IAAA,MAAM,IAAA,GAAO,IAAI,GAAA,CAAI,GAAA,CAAI,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,EAAA,EAAI,CAAC,CAAC,CAAC,CAAA;AAC9C,IAAA,MAAM,MAAA,GAASC,kCAAA,CAAiB,OAAA,CAAQ,CAAC,EAAA,KAAO;AAC9C,MAAA,MAAM,CAAA,GAAI,IAAA,CAAK,GAAA,CAAI,EAAE,CAAA;AACrB,MAAA,OAAO,CAAA,GAAI,CAAC,CAAC,CAAA,GAAI,EAAC;AAAA,IACpB,CAAC,CAAA;AACD,IAAA,OAAO;AAAA,MACL,MAAA,EAAQ,GAAA;AAAA,MACR,aAAA;AAAA,MACA,KAAA,EAAO,aAAA,GAAgB,CAAC,GAAG,QAAA,EAAU,GAAGC,iCAAA,CAAgB,UAAA,EAAY,KAAK,CAAC,CAAA,GAAI,EAAC;AAAA,MAC/E,SAAA,EAAW,CAAC,GAAG,MAAA,EAAQ,GAAG,UAAU,CAAA;AAAA,MACpC,QAAA,EAAU,CAACC,6BAAA,EAAa,GAAG,GAAA,CAAI,MAAA,CAAO,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,CAAA,EAAGC,6BAAW;AAAA,KAC1E;AAAA,EACF,CAAA,EAAG,CAAC,UAAA,EAAY,QAAA,EAAU,OAAO,aAAA,EAAe,GAAA,EAAK,UAAU,CAAC,CAAA;AAClE","file":"chunk-YST6GVN5.cjs","sourcesContent":["/**\n * Creating and updating work and workflows from the composer, in one place.\n *\n * \"Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport {\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useUpdateWorkflow,\n useDocuments,\n useArbiSessionState,\n useCreateWork,\n useStartTaskQuery,\n useUpdateConversation,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport type { components } from '@arbidocs/client'\nimport { useCallback, useMemo } from 'react'\nimport {\n composerToWorkflowUpdate,\n taskComposerToCreateRequest,\n taskComposerToUpdateRequest,\n} from '../../agents/tasks/taskRequest'\nimport { type TaskComposerValues } from '../../agents/tasks/taskComposerTypes'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport type { TaskPlan } from '../../agents/workflows/planSteps'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\ntype Task = components['schemas']['ConversationResponse']\ntype Workflow = components['schemas']['WorkflowResponse']\n\nexport interface TaskSubmitContext {\n workflow: WorkflowDefinition\n values: TaskComposerValues\n /** Goal checklist for agent work, if one was drafted. */\n plan?: TaskPlan | null\n}\n\n/** What a composer submission created. `ran` is null for work no agent runs. */\nexport type CreateOutcome =\n | { kind: 'work'; task: Pick<Task, 'title'> & { external_id?: string }; ran: boolean | null }\n | { kind: 'workflow'; workflow: Workflow }\n\nexport function useWorkflowTasks() {\n const runWorkflow = useRunWorkflow()\n const startQuery = useStartTaskQuery()\n const createWorkflow = useCreateWorkflow()\n const updateConversation = useUpdateConversation()\n const updateWorkflowMutation = useUpdateWorkflow()\n const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId)\n const createWork = useCreateWork({ workspaceId: activeWorkspaceId })\n const { openFiles } = useBlocksEnvironment()\n\n // Standing access for a workflow's agent, so its unattended runs can read the workspace. An agent\n // that is already a member makes the server refuse the re-grant: that is no failure here.\n const { mutateAsync: grant } = useGrantAgentAccess()\n const grantAgentAccess = useCallback(\n (agentExtId: string, workspaceId: string) =>\n grant({ agentExtId, workspaceId }).then(\n () => undefined,\n () => undefined\n ),\n [grant]\n )\n // File names for the prompt's wording (\"the document <name>\"): the server is told the ids as well.\n const { data: documents = [] } = useDocuments()\n const documentTitles = useMemo(\n () =>\n Object.fromEntries(documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])),\n [documents]\n )\n\n /**\n * Create work or a workflow. `forceWorkflow` is for the workflow dialog, where even a reminder is\n * saved as a workflow.\n */\n const create = useCallback(\n async (ctx: TaskSubmitContext, forceWorkflow = false): Promise<CreateOutcome> => {\n const request = taskComposerToCreateRequest(\n { ...ctx, documentTitles, plan: ctx.plan ?? null },\n activeWorkspaceId ?? undefined,\n forceWorkflow\n )\n if (request.kind === 'workflow') {\n const workflow = await createWorkflow.mutateAsync(request.body)\n // Keep access: deposit the key for the agent the server assigned (the Assistant when none was\n // picked), while the owner is here, so unattended runs start on their own.\n const workspaceId = workflow.workspace_ext_id ?? request.body.workspace_ext_id\n if (\n workflow.auth_mode === 'scheduled_permanent' &&\n !workflow.on_demand &&\n workflow.agent_ext_id &&\n workspaceId\n ) {\n await grantAgentAccess(workflow.agent_ext_id, workspaceId)\n }\n if (ctx.workflow.documentAction && ctx.values.when === 'now' && !forceWorkflow) {\n const result = await runWorkflow.mutateAsync(workflow.external_id)\n if (result.error) throw new Error(result.error)\n openFiles()\n }\n return { kind: 'workflow', workflow }\n }\n if (request.kind === 'query') {\n // Run now is the person's own assistant query: it makes the thread a task and runs it.\n const { conversationId } = await startQuery.start(request.query)\n return {\n kind: 'work',\n task: { external_id: conversationId, title: request.query.task.title ?? null },\n ran: true,\n }\n }\n // A plain to-do (or reminder): a task with no run.\n const task = await createWork.mutateAsync(request.body)\n return { kind: 'work', task, ran: null }\n },\n [\n activeWorkspaceId,\n createWork,\n createWorkflow,\n documentTitles,\n grantAgentAccess,\n startQuery,\n runWorkflow,\n openFiles,\n ]\n )\n\n /** PATCH the editable fields of a task (the instruction, workspace and agent stay as created). */\n const update = useCallback(\n async (task: Pick<Task, 'external_id'> & { is_owner?: boolean }, ctx: TaskSubmitContext) => {\n const patch = taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null })\n // Who can see a task is its owner's to change: an editor's save leaves it out.\n if (task.is_owner === false) delete patch.shared\n await updateConversation.mutateAsync({ conversationId: task.external_id, patch })\n },\n [updateConversation]\n )\n\n /** PATCH a workflow: its name, trigger and action. */\n const updateWorkflow = useCallback(\n async (\n workflow: Pick<Workflow, 'external_id' | 'agent_ext_id' | 'workspace_ext_id'> & {\n is_owner?: boolean\n },\n ctx: TaskSubmitContext\n ) => {\n const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null })\n // Sharing a workflow is its owner's: an editor's save leaves it out.\n if (workflow.is_owner === false) delete patch.shared\n const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId\n const updated = await updateWorkflowMutation.mutateAsync({\n workflowId: workflow.external_id,\n patch,\n })\n // The agent the server keeps (the Assistant when none was picked) gets the key for unattended runs.\n const agentId = updated.agent_ext_id ?? patch.agent_ext_id ?? workflow.agent_ext_id\n if (\n updated.auth_mode === 'scheduled_permanent' &&\n !updated.on_demand &&\n agentId &&\n workspaceId\n ) {\n await grantAgentAccess(agentId, workspaceId)\n }\n },\n [activeWorkspaceId, documentTitles, grantAgentAccess, updateWorkflowMutation]\n )\n\n return {\n create,\n update,\n updateWorkflow,\n isPending:\n createWork.isPending ||\n startQuery.isPending ||\n createWorkflow.isPending ||\n updateConversation.isPending ||\n updateWorkflowMutation.isPending,\n }\n}\n","import { useArbiSession } from '@arbidocs/react'\n\n/** The account fields that say it is an external one. */\ninterface AccountKind {\n temporary_access_only?: boolean | null\n user_type?: string | null\n}\n\n/** An external account: temporary access to shared workspaces only. */\nexport const isExternalAccount = (user: AccountKind | null | undefined): boolean =>\n !!user && (user.temporary_access_only === true || user.user_type === 'external')\n\n/**\n * Whether the signed-in person is an external guest. They get the built-in skills and the host's\n * skill packs, never the marketplace (the backend enforces it as well).\n */\nexport function useIsExternalAccount(): boolean {\n return isExternalAccount(useArbiSession().user)\n}\n\n/** Skill listings without the marketplace's (`visibility: global`): what an external guest gets. */\nexport const withoutMarketplace = <T extends { visibility?: string | null }>(listings: T[]): T[] =>\n listings.filter((s) => s.visibility !== 'global')\n","/**\n * The one gate for everything skill-shaped in the app: the empty chat's Start list, the skill\n * entries of the slash menu, the sidebar's Skills item, the Skills browser's entry points and the\n * typed `/skill` interception. It is the personal `show_skills` user setting, default off; the\n * switch lives in Settings, Experimental (developers only), so today only developers have it.\n */\n\nimport { useUserSettings } from '@arbidocs/react'\nimport { useIsExternalAccount } from '../useIsExternalAccount'\n\nexport function useSkillsEnabled(): boolean {\n const { data: userSettings } = useUserSettings()\n return userSettings?.show_skills ?? false\n}\n\n/**\n * Whether the Skills browser (the marketplace: \"Browse skills\", the Skills menu entry) is offered:\n * to skills users, never to an external guest (the backend enforces it as well).\n */\nexport function useCanBrowseSkills(): boolean {\n const skillsEnabled = useSkillsEnabled()\n const isExternal = useIsExternalAccount()\n return skillsEnabled && !isExternal\n}\n","/**\n * The host's skill packs (`host.workflows.skillPacks`) as the kit's workflows, and the `/` menu's\n * rows for them: one section per heading (a category, else a pack's label).\n */\nimport { useMemo } from 'react'\nimport { skillPackWorkflows, type SkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { useHost } from '../../provider/host'\n\n/** The section heading of a pack without a label or category. */\nconst DEFAULT_PACK_LABEL = 'Skills from this site'\n\nconst NO_PACKS: SkillPackWorkflow[] = []\n\nexport function useHostSkills(): SkillPackWorkflow[] {\n const packs = useHost().workflows?.skillPacks\n return useMemo(() => (packs?.length ? packs.flatMap(skillPackWorkflows) : NO_PACKS), [packs])\n}\n\n/**\n * A pack skill's `/` menu row. Its section is its heading (its category, else its pack's label), so\n * skills of several packs under one heading share one section.\n */\nexport function hostSkillItem(workflow: SkillPackWorkflow): SlashMenuItem {\n const label = workflow.category ?? workflow.pack.label ?? DEFAULT_PACK_LABEL\n return {\n name: workflow.id,\n description: workflow.description,\n kind: 'skill',\n group: { id: `pack-${label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`, label },\n }\n}\n","import { useMemo } from 'react'\nimport { useAssistantCopy } from '@arbidocs/react/shell'\nimport { nameBuiltinWorkflows } from '../../agents/workflows/catalogue/seed'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\n\n/** The seeded workflows in the host's assistant name (`nameBuiltinWorkflows`). */\nexport function useNamedWorkflows(\n workflows: ReadonlyArray<WorkflowDefinition>\n): WorkflowDefinition[] {\n const copy = useAssistantCopy()\n return useMemo(() => nameBuiltinWorkflows(workflows, copy), [workflows, copy])\n}\n","/**\n * The one list of workflows: the seeded ones plus every skill the user can invoke (each degraded\n * to a single-field form from its `arg_hint`). The dashboard tiles, the slash menu, tasks and\n * agents all read this.\n */\n\nimport { useMemo } from 'react'\nimport { useSkills } from '@arbidocs/react'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport {\n CUSTOM_TASK,\n DASHBOARD_OPERATIONS,\n DASHBOARD_PINNED,\n REMIND_TASK,\n} from '../../agents/workflows/catalogue/seed'\nimport { useSkillsEnabled } from './useSkillsEnabled'\nimport { useHostSkills } from './useHostSkills'\nimport { useIsExternalAccount, withoutMarketplace } from '../useIsExternalAccount'\nimport { sortByRecentUse, useWorkflowUsage } from '../../agents/workflows/catalogue/workflow-usage'\nimport { WEB_WORKFLOWS } from '../../agents/workflows/catalogue/registry'\nimport { useNamedWorkflows } from './useNamedWorkflows'\n\nexport interface UseWorkflowDefinitionsResult {\n /**\n * Every skill workflow of this host: built-ins, the host's skill packs, then the user's and the\n * marketplace's (one list).\n */\n skills: WorkflowDefinition[]\n /** The user has skills switched on (`show_skills`): the gate of every skill-shaped surface. */\n skillsEnabled: boolean\n /**\n * The empty chat's Start section: built-ins first (their own order), then the user's own and\n * marketplace skills by recent use, then name. EMPTY for users without skills enabled.\n */\n start: WorkflowDefinition[]\n /** The dashboard Start band: pinned skills in order, then the operation launchers. */\n dashboard: WorkflowDefinition[]\n /** What a task can run: schedulable skills plus a free instruction and a reminder. */\n forTasks: WorkflowDefinition[]\n}\n\n/**\n * The skill listings a person may use from the menus: a host pack's slug is the pack's (an\n * installed copy is the same skill), and an external guest gets no marketplace skills.\n */\nexport function useUsableSkillListings(hostSkills: ReadonlyArray<WorkflowDefinition>) {\n const { data: listings } = useSkills()\n const isExternal = useIsExternalAccount()\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n const usable = (listings ?? []).filter((s) => !packSlugs.has(s.slug))\n return isExternal ? withoutMarketplace(usable) : usable\n }, [listings, hostSkills, isExternal])\n}\n\nexport function useWorkflowDefinitions(): UseWorkflowDefinitionsResult {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const usage = useWorkflowUsage()\n const skillsEnabled = useSkillsEnabled()\n const web = useNamedWorkflows(WEB_WORKFLOWS)\n const operations = useNamedWorkflows(DASHBOARD_OPERATIONS)\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n // An uploaded skill of a built-in's slug is used instead of it.\n const { host: builtins, skills: fromServer } = mergeSkillWorkflows(\n web.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n // The host's packs sit with the built-ins; they are listed in the menus, not in Start.\n const all = [...builtins, ...hostSkills, ...fromServer]\n const byId = new Map(all.map((w) => [w.id, w]))\n const pinned = DASHBOARD_PINNED.flatMap((id) => {\n const w = byId.get(id)\n return w ? [w] : []\n })\n return {\n skills: all,\n skillsEnabled,\n start: skillsEnabled ? [...builtins, ...sortByRecentUse(fromServer, usage)] : [],\n dashboard: [...pinned, ...operations],\n forTasks: [CUSTOM_TASK, ...all.filter((w) => w.schedulable), REMIND_TASK],\n }\n }, [hostSkills, listings, usage, skillsEnabled, web, operations])\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/workflows/useWorkflowTasks.ts","../src/connection/useIsExternalAccount.ts","../src/connection/workflows/useSkillsEnabled.ts","../src/connection/workflows/useHostSkills.ts","../src/connection/workflows/useNamedWorkflows.ts","../src/connection/workflows/useWorkflowDefinitions.ts"],"names":["useRunWorkflow","useStartTaskQuery","useCreateWorkflow","useUpdateConversation","useUpdateWorkflow","useArbiSessionState","useCreateWork","useBlocksEnvironment","useGrantAgentAccess","useCallback","useDocuments","useMemo","getDocumentTitle","taskComposerToCreateRequest","taskComposerToUpdateRequest","composerToWorkflowUpdate","useArbiSession","useUserSettings","useHost","skillPackWorkflows","useAssistantCopy","nameBuiltinWorkflows","useSkills","useWorkflowUsage","WEB_WORKFLOWS","DASHBOARD_OPERATIONS","mergeSkillWorkflows","DASHBOARD_PINNED","sortByRecentUse","CUSTOM_TASK","REMIND_TASK"],"mappings":";;;;;;;;;;;AAuDO,SAAS,gBAAA,GAAmB;AACjC,EAAA,MAAM,cAAcA,oBAAA,EAAe;AACnC,EAAA,MAAM,aAAaC,uBAAA,EAAkB;AACrC,EAAA,MAAM,iBAAiBC,uBAAA,EAAkB;AACzC,EAAA,MAAM,qBAAqBC,2BAAA,EAAsB;AACjD,EAAA,MAAM,yBAAyBC,uBAAA,EAAkB;AACjD,EAAA,MAAM,iBAAA,GAAoBC,yBAAA,CAAoB,CAAC,CAAA,KAAM,EAAE,WAAW,CAAA;AAClE,EAAA,MAAM,UAAA,GAAaC,mBAAA,CAAc,EAAE,WAAA,EAAa,mBAAmB,CAAA;AACnE,EAAA,MAAM,EAAE,SAAA,EAAU,GAAIC,sCAAA,EAAqB;AAI3C,EAAA,MAAM,EAAE,WAAA,EAAa,KAAA,EAAM,GAAIC,yBAAA,EAAoB;AACnD,EA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AAA,KAC1E;AAAA,EACF,CAAA,EAAG,CAAC,UAAA,EAAY,QAAA,EAAU,OAAO,aAAA,EAAe,GAAA,EAAK,UAAU,CAAC,CAAA;AAClE","file":"chunk-2Q32RXY2.cjs","sourcesContent":["/**\n * Creating and updating work and workflows from the composer, in one place.\n *\n * \"Now\" is an assistant query with task options (the person's own run: the thread becomes a task); a plain\n * to-do creates work with no run. Any other start (a date, a repeat, an event, after another task) saves a workflow\n * that creates the work when it fires. The request mapping is shared with every host (and tested in\n * blocks): `taskComposerToCreateRequest` decides which.\n *\n * Workspace authorization is a per-run, least-privilege choice (`auth_mode`) composed over the shipped\n * workspace-access-request + grant machinery:\n * - Now -> no tier: the query runs as the person asking, with their own access.\n * - Workflow -> `scheduled_require_auth` by default (asks at run time), or `scheduled_permanent`\n * (\"keep access\"): standing membership so unattended runs can decrypt while the owner\n * is away. Only this tier grants membership.\n */\n\nimport {\n useCreateWorkflow,\n useGrantAgentAccess,\n useRunWorkflow,\n useUpdateWorkflow,\n useDocuments,\n useArbiSessionState,\n useCreateWork,\n useStartTaskQuery,\n useUpdateConversation,\n} from '@arbidocs/react'\nimport { getDocumentTitle } from '@arbidocs/react/ui'\nimport type { components } from '@arbidocs/client'\nimport { useCallback, useMemo } from 'react'\nimport {\n composerToWorkflowUpdate,\n taskComposerToCreateRequest,\n taskComposerToUpdateRequest,\n} from '../../agents/tasks/taskRequest'\nimport { type TaskComposerValues } from '../../agents/tasks/taskComposerTypes'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport type { TaskPlan } from '../../agents/workflows/planSteps'\nimport { useBlocksEnvironment } from '../../provider/environment'\n\ntype Task = components['schemas']['ConversationResponse']\ntype Workflow = components['schemas']['WorkflowResponse']\n\nexport interface TaskSubmitContext {\n workflow: WorkflowDefinition\n values: TaskComposerValues\n /** Goal checklist for agent work, if one was drafted. */\n plan?: TaskPlan | null\n}\n\n/** What a composer submission created. `ran` is null for work no agent runs. */\nexport type CreateOutcome =\n | { kind: 'work'; task: Pick<Task, 'title'> & { external_id?: string }; ran: boolean | null }\n | { kind: 'workflow'; workflow: Workflow }\n\nexport function useWorkflowTasks() {\n const runWorkflow = useRunWorkflow()\n const startQuery = useStartTaskQuery()\n const createWorkflow = useCreateWorkflow()\n const updateConversation = useUpdateConversation()\n const updateWorkflowMutation = useUpdateWorkflow()\n const activeWorkspaceId = useArbiSessionState((s) => s.workspaceId)\n const createWork = useCreateWork({ workspaceId: activeWorkspaceId })\n const { openFiles } = useBlocksEnvironment()\n\n // Standing access for a workflow's agent, so its unattended runs can read the workspace. An agent\n // that is already a member makes the server refuse the re-grant: that is no failure here.\n const { mutateAsync: grant } = useGrantAgentAccess()\n const grantAgentAccess = useCallback(\n (agentExtId: string, workspaceId: string) =>\n grant({ agentExtId, workspaceId }).then(\n () => undefined,\n () => undefined\n ),\n [grant]\n )\n // File names for the prompt's wording (\"the document <name>\"): the server is told the ids as well.\n const { data: documents = [] } = useDocuments()\n const documentTitles = useMemo(\n () =>\n Object.fromEntries(documents.map((d) => [d.external_id, getDocumentTitle(d, d.external_id)])),\n [documents]\n )\n\n /**\n * Create work or a workflow. `forceWorkflow` is for the workflow dialog, where even a reminder is\n * saved as a workflow.\n */\n const create = useCallback(\n async (ctx: TaskSubmitContext, forceWorkflow = false): Promise<CreateOutcome> => {\n const request = taskComposerToCreateRequest(\n { ...ctx, documentTitles, plan: ctx.plan ?? null },\n activeWorkspaceId ?? undefined,\n forceWorkflow\n )\n if (request.kind === 'workflow') {\n const workflow = await createWorkflow.mutateAsync(request.body)\n // Keep access: deposit the key for the agent the server assigned (the Assistant when none was\n // picked), while the owner is here, so unattended runs start on their own.\n const workspaceId = workflow.workspace_ext_id ?? request.body.workspace_ext_id\n if (\n workflow.auth_mode === 'scheduled_permanent' &&\n !workflow.on_demand &&\n workflow.agent_ext_id &&\n workspaceId\n ) {\n await grantAgentAccess(workflow.agent_ext_id, workspaceId)\n }\n if (ctx.workflow.documentAction && ctx.values.when === 'now' && !forceWorkflow) {\n const result = await runWorkflow.mutateAsync(workflow.external_id)\n if (result.error) throw new Error(result.error)\n openFiles()\n }\n return { kind: 'workflow', workflow }\n }\n if (request.kind === 'query') {\n // Run now is the person's own assistant query: it makes the thread a task and runs it.\n const { conversationId } = await startQuery.start(request.query)\n return {\n kind: 'work',\n task: { external_id: conversationId, title: request.query.task.title ?? null },\n ran: true,\n }\n }\n // A plain to-do (or reminder): a task with no run.\n const task = await createWork.mutateAsync(request.body)\n return { kind: 'work', task, ran: null }\n },\n [\n activeWorkspaceId,\n createWork,\n createWorkflow,\n documentTitles,\n grantAgentAccess,\n startQuery,\n runWorkflow,\n openFiles,\n ]\n )\n\n /** PATCH the editable fields of a task (the instruction, workspace and agent stay as created). */\n const update = useCallback(\n async (task: Pick<Task, 'external_id'> & { is_owner?: boolean }, ctx: TaskSubmitContext) => {\n const patch = taskComposerToUpdateRequest({ ...ctx, plan: ctx.plan ?? null })\n // Who can see a task is its owner's to change: an editor's save leaves it out.\n if (task.is_owner === false) delete patch.shared\n await updateConversation.mutateAsync({ conversationId: task.external_id, patch })\n },\n [updateConversation]\n )\n\n /** PATCH a workflow: its name, trigger and action. */\n const updateWorkflow = useCallback(\n async (\n workflow: Pick<Workflow, 'external_id' | 'agent_ext_id' | 'workspace_ext_id'> & {\n is_owner?: boolean\n },\n ctx: TaskSubmitContext\n ) => {\n const patch = composerToWorkflowUpdate({ ...ctx, documentTitles, plan: ctx.plan ?? null })\n // Sharing a workflow is its owner's: an editor's save leaves it out.\n if (workflow.is_owner === false) delete patch.shared\n const workspaceId = workflow.workspace_ext_id ?? activeWorkspaceId\n const updated = await updateWorkflowMutation.mutateAsync({\n workflowId: workflow.external_id,\n patch,\n })\n // The agent the server keeps (the Assistant when none was picked) gets the key for unattended runs.\n const agentId = updated.agent_ext_id ?? patch.agent_ext_id ?? workflow.agent_ext_id\n if (\n updated.auth_mode === 'scheduled_permanent' &&\n !updated.on_demand &&\n agentId &&\n workspaceId\n ) {\n await grantAgentAccess(agentId, workspaceId)\n }\n },\n [activeWorkspaceId, documentTitles, grantAgentAccess, updateWorkflowMutation]\n )\n\n return {\n create,\n update,\n updateWorkflow,\n isPending:\n createWork.isPending ||\n startQuery.isPending ||\n createWorkflow.isPending ||\n updateConversation.isPending ||\n updateWorkflowMutation.isPending,\n }\n}\n","import { useArbiSession } from '@arbidocs/react'\n\n/** The account fields that say it is an external one. */\ninterface AccountKind {\n temporary_access_only?: boolean | null\n user_type?: string | null\n}\n\n/** An external account: temporary access to shared workspaces only. */\nexport const isExternalAccount = (user: AccountKind | null | undefined): boolean =>\n !!user && (user.temporary_access_only === true || user.user_type === 'external')\n\n/**\n * Whether the signed-in person is an external guest. They get the built-in skills and the host's\n * skill packs, never the marketplace (the backend enforces it as well).\n */\nexport function useIsExternalAccount(): boolean {\n return isExternalAccount(useArbiSession().user)\n}\n\n/** Skill listings without the marketplace's (`visibility: global`): what an external guest gets. */\nexport const withoutMarketplace = <T extends { visibility?: string | null }>(listings: T[]): T[] =>\n listings.filter((s) => s.visibility !== 'global')\n","/**\n * The one gate for everything skill-shaped in the app: the empty chat's Start list, the skill\n * entries of the slash menu, the sidebar's Skills item, the Skills browser's entry points and the\n * typed `/skill` interception. It is the personal `show_skills` user setting, default off; the\n * switch lives in Settings, Experimental (developers only), so today only developers have it.\n */\n\nimport { useUserSettings } from '@arbidocs/react'\nimport { useIsExternalAccount } from '../useIsExternalAccount'\n\nexport function useSkillsEnabled(): boolean {\n const { data: userSettings } = useUserSettings()\n return userSettings?.show_skills ?? false\n}\n\n/**\n * Whether the Skills browser (the marketplace: \"Browse skills\", the Skills menu entry) is offered:\n * to skills users, never to an external guest (the backend enforces it as well).\n */\nexport function useCanBrowseSkills(): boolean {\n const skillsEnabled = useSkillsEnabled()\n const isExternal = useIsExternalAccount()\n return skillsEnabled && !isExternal\n}\n","/**\n * The host's skill packs (`host.workflows.skillPacks`) as the kit's workflows, and the `/` menu's\n * rows for them: one section per heading (a category, else a pack's label).\n */\nimport { useMemo } from 'react'\nimport { skillPackWorkflows, type SkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { useHost } from '../../provider/host'\n\n/** The section heading of a pack without a label or category. */\nconst DEFAULT_PACK_LABEL = 'Skills from this site'\n\nconst NO_PACKS: SkillPackWorkflow[] = []\n\nexport function useHostSkills(): SkillPackWorkflow[] {\n const packs = useHost().workflows?.skillPacks\n return useMemo(() => (packs?.length ? packs.flatMap(skillPackWorkflows) : NO_PACKS), [packs])\n}\n\n/**\n * A pack skill's `/` menu row. Its section is its heading (its category, else its pack's label), so\n * skills of several packs under one heading share one section.\n */\nexport function hostSkillItem(workflow: SkillPackWorkflow): SlashMenuItem {\n const label = workflow.category ?? workflow.pack.label ?? DEFAULT_PACK_LABEL\n return {\n name: workflow.id,\n description: workflow.description,\n kind: 'skill',\n group: { id: `pack-${label.toLowerCase().replace(/[^a-z0-9]+/g, '-')}`, label },\n }\n}\n","import { useMemo } from 'react'\nimport { useAssistantCopy } from '@arbidocs/react/shell'\nimport { nameBuiltinWorkflows } from '../../agents/workflows/catalogue/seed'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\n\n/** The seeded workflows in the host's assistant name (`nameBuiltinWorkflows`). */\nexport function useNamedWorkflows(\n workflows: ReadonlyArray<WorkflowDefinition>\n): WorkflowDefinition[] {\n const copy = useAssistantCopy()\n return useMemo(() => nameBuiltinWorkflows(workflows, copy), [workflows, copy])\n}\n","/**\n * The one list of workflows: the seeded ones plus every skill the user can invoke (each degraded\n * to a single-field form from its `arg_hint`). The dashboard tiles, the slash menu, tasks and\n * agents all read this.\n */\n\nimport { useMemo } from 'react'\nimport { useSkills } from '@arbidocs/react'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport { type WorkflowDefinition } from '../../agents/workflows/types'\nimport {\n CUSTOM_TASK,\n DASHBOARD_OPERATIONS,\n DASHBOARD_PINNED,\n REMIND_TASK,\n} from '../../agents/workflows/catalogue/seed'\nimport { useSkillsEnabled } from './useSkillsEnabled'\nimport { useHostSkills } from './useHostSkills'\nimport { useIsExternalAccount, withoutMarketplace } from '../useIsExternalAccount'\nimport { sortByRecentUse, useWorkflowUsage } from '../../agents/workflows/catalogue/workflow-usage'\nimport { WEB_WORKFLOWS } from '../../agents/workflows/catalogue/registry'\nimport { useNamedWorkflows } from './useNamedWorkflows'\n\nexport interface UseWorkflowDefinitionsResult {\n /**\n * Every skill workflow of this host: built-ins, the host's skill packs, then the user's and the\n * marketplace's (one list).\n */\n skills: WorkflowDefinition[]\n /** The user has skills switched on (`show_skills`): the gate of every skill-shaped surface. */\n skillsEnabled: boolean\n /**\n * The empty chat's Start section: built-ins first (their own order), then the user's own and\n * marketplace skills by recent use, then name. EMPTY for users without skills enabled.\n */\n start: WorkflowDefinition[]\n /** The dashboard Start band: pinned skills in order, then the operation launchers. */\n dashboard: WorkflowDefinition[]\n /** What a task can run: schedulable skills plus a free instruction and a reminder. */\n forTasks: WorkflowDefinition[]\n}\n\n/**\n * The skill listings a person may use from the menus: a host pack's slug is the pack's (an\n * installed copy is the same skill), and an external guest gets no marketplace skills.\n */\nexport function useUsableSkillListings(hostSkills: ReadonlyArray<WorkflowDefinition>) {\n const { data: listings } = useSkills()\n const isExternal = useIsExternalAccount()\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n const usable = (listings ?? []).filter((s) => !packSlugs.has(s.slug))\n return isExternal ? withoutMarketplace(usable) : usable\n }, [listings, hostSkills, isExternal])\n}\n\nexport function useWorkflowDefinitions(): UseWorkflowDefinitionsResult {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const usage = useWorkflowUsage()\n const skillsEnabled = useSkillsEnabled()\n const web = useNamedWorkflows(WEB_WORKFLOWS)\n const operations = useNamedWorkflows(DASHBOARD_OPERATIONS)\n return useMemo(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n // An uploaded skill of a built-in's slug is used instead of it.\n const { host: builtins, skills: fromServer } = mergeSkillWorkflows(\n web.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n // The host's packs sit with the built-ins; they are listed in the menus, not in Start.\n const all = [...builtins, ...hostSkills, ...fromServer]\n const byId = new Map(all.map((w) => [w.id, w]))\n const pinned = DASHBOARD_PINNED.flatMap((id) => {\n const w = byId.get(id)\n return w ? [w] : []\n })\n return {\n skills: all,\n skillsEnabled,\n start: skillsEnabled ? [...builtins, ...sortByRecentUse(fromServer, usage)] : [],\n dashboard: [...pinned, ...operations],\n forTasks: [CUSTOM_TASK, ...all.filter((w) => w.schedulable), REMIND_TASK],\n }\n }, [hostSkills, listings, usage, skillsEnabled, web, operations])\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkOUGRCQM7_cjs = require('./chunk-OUGRCQM7.cjs');
5
4
  var chunkKQF7POTG_cjs = require('./chunk-KQF7POTG.cjs');
5
+ var chunkOUGRCQM7_cjs = require('./chunk-OUGRCQM7.cjs');
6
6
  var chunkPLIF5CUV_cjs = require('./chunk-PLIF5CUV.cjs');
7
7
  var lucideReact = require('lucide-react');
8
8
  var ui = require('@arbidocs/react/ui');
@@ -555,5 +555,5 @@ exports.prefetchChunk = prefetchChunk;
555
555
  exports.requestReload = requestReload;
556
556
  exports.workspaceKindColor = workspaceKindColor;
557
557
  exports.workspaceKindMeta = workspaceKindMeta;
558
- //# sourceMappingURL=chunk-VCDD763Y.cjs.map
559
- //# sourceMappingURL=chunk-VCDD763Y.cjs.map
558
+ //# sourceMappingURL=chunk-7HU2NQVO.cjs.map
559
+ //# sourceMappingURL=chunk-7HU2NQVO.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/shell/Workspace.tsx","../src/shell/MobileBars.tsx","../src/shell/reload-policy.ts"],"names":["Globe","Users","Lock","jsxs","jsx","testIdOr","cn","Fragment","DropdownMenu","DropdownMenuTrigger","ChevronDown","DropdownMenuContent","DropdownMenuItem","LayoutGrid","Pl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AO,CAAA,EAAG,CAAC,CAAA;AACrC;AAEA,SAAS,WAAW,KAAA,EAAoB;AACtC,EAAA,YAAA,GAAe,KAAK,GAAA,EAAI;AACxB,EAAA,IAAI,KAAA,CAAM,SAAS,OAAA,IAAW,KAAA,CAAM,kBAAkB,OAAA,IAAW,WAAA,CAAY,KAAA,CAAM,MAAM,CAAA,EAAG;AAC1F,IAAA,MAAA,CAAO,GAAA,CAAI,MAAM,MAAM,CAAA;AAAA,EACzB;AACF;AAEA,IAAM,kBAAkB,CAAC,OAAA,EAAS,SAAA,EAAW,aAAA,EAAe,SAAS,YAAY,CAAA;AAG1E,SAAS,mBAAA,CAAoB,SAAA,GAAuC,EAAC,EAAS;AACnF,EAAA,IAAA,GAAO,EAAE,GAAG,WAAA,EAAa,GAAG,SAAA,EAAU;AACtC,EAAA,IAAI,SAAA,IAAa,OAAO,MAAA,KAAW,WAAA,EAAa;AAChD,EAAA,SAAA,GAAY,IAAA;AACZ,EAAA,YAAA,GAAe,KAAK,GAAA,EAAI;AACxB,EAAA,MAAA,CAAO,gBAAA,CAAiB,qBAAqB,oBAAoB,CAAA;AACjE,EAAA,KAAA,MAAW,QAAQ,eAAA,EAAiB;AAClC,IAAA,QAAA,CAAS,gBAAA,CAAiB,MAAM,UAAA,EAAY,EAAE,SAAS,IAAA,EAAM,OAAA,EAAS,MAAM,CAAA;AAAA,EAC9E;AACF","file":"chunk-VCDD763Y.cjs","sourcesContent":["import type { ComponentType } from 'react'\nimport { ChevronDown, Globe, LayoutGrid, Lock, Plus, Users } from 'lucide-react'\nimport {\n cn,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@arbidocs/react/ui'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport type { ShellRecentWorkspace, ShellWorkspace, ShellWorkspaceKind } from './types'\n\n/** The three workspace-kind names (badge title, type glyph name, subtitle). */\nexport interface WorkspaceKindLabels {\n common: string\n shared: string\n private: string\n}\n\nexport const DEFAULT_WORKSPACE_KIND_LABELS: WorkspaceKindLabels = {\n common: 'Common',\n shared: 'Shared',\n private: 'Private',\n}\n\n/**\n * Workspace type drives the initial-badge fill and a quiet secondary glyph:\n * private (just you) -> navy, lock shared (several) -> selection tint, people\n * common (public) -> neutral, globe\n * Navy is identity and cyan is reserved for ARBI/AI, so \"shared\" is the selection tint.\n */\nexport function workspaceKindMeta(\n kind: ShellWorkspaceKind,\n labels?: Partial<WorkspaceKindLabels>\n): {\n Icon: ComponentType<{ className?: string; 'aria-label'?: string; 'data-testid'?: string }>\n label: string\n fill: string\n} {\n const l = { ...DEFAULT_WORKSPACE_KIND_LABELS, ...labels }\n if (kind === 'common')\n return { Icon: Globe, label: l.common, fill: 'bg-muted text-muted-foreground' }\n if (kind === 'shared')\n return { Icon: Users, label: l.shared, fill: 'bg-secondary text-secondary-foreground' }\n return { Icon: Lock, label: l.private, fill: 'bg-primary text-primary-foreground' }\n}\n\n/** The kind's hue as a CSS colour, for glyphs painted by SVG fill (the workspace shield). */\nexport function workspaceKindColor(kind: ShellWorkspaceKind): string {\n if (kind === 'common') return 'var(--color-muted-foreground)'\n if (kind === 'shared') return 'var(--color-secondary)'\n return 'var(--color-primary)'\n}\n\n/** Overridable ids of the workspace identity; defaults are the current ids. */\ntype WorkspaceIdentityTestIds = Partial<Record<'initial' | 'type' | 'projectName', string>>\n\nexport interface WorkspaceIdentityProps {\n workspace: ShellWorkspace\n /** Show name + type/project line beside the badge; otherwise the badge alone. */\n expanded: boolean\n /** Selected (nav-row) styling of the name. */\n isActive?: boolean\n /** Reword the kind names. */\n labels?: Partial<WorkspaceKindLabels>\n /** Part ids; defaults are the current ids. */\n testIds?: WorkspaceIdentityTestIds\n}\n\n/**\n * Non-interactive guts of the workspace head: the initial badge (with a tiny type glyph) and,\n * when expanded, the name and the project/type line. Hosted by the switcher trigger and by the\n * workspace settings header, so it never nests a button.\n */\nexport function WorkspaceIdentity({\n workspace,\n expanded,\n isActive = false,\n labels,\n testIds,\n}: WorkspaceIdentityProps) {\n const kind = workspaceKindMeta(workspace.kind, labels)\n const badge = (\n <span className=\"relative flex flex-shrink-0\" title={kind.label}>\n <span\n aria-hidden=\"true\"\n data-testid={testIdOr(testIds?.initial, { testId: 'sidebar-workspace-card-initial' })}\n className={cn(\n 'flex size-7 flex-shrink-0 items-center justify-center rounded-md text-sm font-semibold leading-none',\n kind.fill\n )}\n >\n {workspace.name.charAt(0).toUpperCase()}\n </span>\n {/* Type as a tiny overlay on the badge: status reads at the icon, not after the name. */}\n <span className=\"absolute -bottom-1 -right-1 flex size-3.5 items-center justify-center rounded-full bg-background ring-1 ring-border\">\n <kind.Icon\n aria-label={kind.label}\n data-testid={testIdOr(testIds?.type, { testId: 'sidebar-workspace-card-type' })}\n className=\"size-2.5 text-muted-foreground\"\n />\n </span>\n </span>\n )\n\n if (!expanded)\n return <div className=\"flex flex-shrink-0 items-center justify-center\">{badge}</div>\n\n return (\n <>\n <div className=\"flex flex-shrink-0 items-center justify-center\">{badge}</div>\n <div className=\"ml-2.5 flex min-w-0 flex-1 flex-col text-left\">\n <span\n // 600: the name of the thing you are inside, above a lighter project line.\n className={cn(\n 'min-w-0 truncate text-left text-sm font-semibold capitalize leading-tight transition-colors duration-100',\n isActive ? 'text-accent-foreground' : 'text-foreground'\n )}\n >\n {workspace.name}\n </span>\n {!workspace.projectName && (\n <span className=\"mt-0.5 truncate text-xs text-muted-foreground\">{kind.label}</span>\n )}\n {workspace.projectName && (\n <span\n className=\"mt-0.5 flex min-w-0\"\n data-testid={testIdOr(testIds?.projectName, {\n testId: 'sidebar-workspace-card-project-name',\n })}\n >\n {workspace.projectLine ?? (\n <span className=\"truncate text-xs text-muted-foreground\">\n {workspace.projectName}\n </span>\n )}\n </span>\n )}\n </div>\n </>\n )\n}\n\n/**\n * Entity nouns plus the switcher's strings. `plural` arrives lowercased and `singular`\n * capitalized in the functions below.\n */\nexport interface WorkspaceSwitcherLabels extends WorkspaceKindLabels {\n /** Entity nouns, e.g. { plural: 'workspaces', singular: 'workspace' }. */\n plural: string\n singular: string\n /** The trigger's accessible name. */\n switchWorkspace: (name: string, plural: string) => string\n allWorkspaces: (plural: string) => string\n newWorkspace: (singular: string) => string\n recentWorkspaces: (plural: string) => string\n}\n\nexport const DEFAULT_WORKSPACE_SWITCHER_LABELS: WorkspaceSwitcherLabels = {\n ...DEFAULT_WORKSPACE_KIND_LABELS,\n plural: 'workspaces',\n singular: 'workspace',\n switchWorkspace: (name, plural) => `${name} — switch ${plural}`,\n allWorkspaces: (plural) => `All ${plural}`,\n newWorkspace: (singular) => `New ${singular}`,\n recentWorkspaces: (plural) => `Recent ${plural}`,\n}\n\nexport interface WorkspaceSwitcherProps {\n workspace: ShellWorkspace\n /** Other workspaces to jump to (the app orders and caps them). */\n recent?: ShellRecentWorkspace[]\n /** Icon-only trigger (the sidebar rail). */\n compact?: boolean\n /** `appbar`: the phone app bar's title, name + chevron on one line. */\n variant?: 'sidebar' | 'appbar'\n onSwitch: (workspace: ShellWorkspace) => void\n /** Return to the workspaces list; leaves the workspace open. */\n onGoToList: () => void\n onNewWorkspace: () => void\n /**\n * When set, \"New workspace\" is shown disabled with this explanation under it (e.g. the user may\n * not create workspaces on this deployment).\n */\n newWorkspaceDisabledReason?: string\n /** Entity nouns and menu strings; any subset (the nouns default to workspace(s)). */\n labels?: Partial<WorkspaceSwitcherLabels>\n className?: string\n /** Trigger id (default `workspace-switcher-trigger`). */\n testId?: string\n /**\n * Part ids; defaults are the current ids. `switchItem`, `type` and `lastSeen` are prefixes\n * (`<prefix>-<workspace id>`).\n */\n testIds?: Partial<Record<'menu' | 'all' | 'new' | 'switchItem' | 'type' | 'lastSeen', string>>\n /** Ids forwarded to the trigger's workspace identity. */\n identityTestIds?: WorkspaceIdentityTestIds\n}\n\n/**\n * The current-workspace control as a dropdown: \"All workspaces\", \"New workspace\", then the\n * recent workspaces to jump straight into.\n */\nexport function WorkspaceSwitcher({\n workspace,\n recent = [],\n compact = false,\n variant = 'sidebar',\n onSwitch,\n onGoToList,\n onNewWorkspace,\n newWorkspaceDisabledReason,\n labels,\n className,\n testId,\n testIds,\n identityTestIds,\n}: WorkspaceSwitcherProps) {\n const l = { ...DEFAULT_WORKSPACE_SWITCHER_LABELS, ...labels }\n const plural = l.plural.toLowerCase()\n const singular = l.singular.charAt(0).toUpperCase() + l.singular.slice(1)\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n data-slot=\"workspace-switcher\"\n data-testid={testIdOr(testId, { testId: 'workspace-switcher-trigger' })}\n aria-label={l.switchWorkspace(workspace.name, plural)}\n className={cn(\n 'group flex min-w-0 items-center rounded-md transition-colors duration-100 hover:bg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n variant === 'appbar'\n ? 'h-11 max-w-full gap-1 px-2'\n : compact\n ? 'h-12 w-12 justify-center'\n : 'h-12 w-full px-2',\n className\n )}\n >\n {variant === 'appbar' ? (\n <span className=\"min-w-0 truncate text-base font-semibold text-foreground\">\n {workspace.name}\n </span>\n ) : (\n <WorkspaceIdentity\n workspace={workspace}\n expanded={!compact}\n labels={l}\n testIds={identityTestIds}\n />\n )}\n {!(compact && variant === 'sidebar') && (\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ml-auto size-4 flex-shrink-0 text-muted-foreground transition-transform duration-150 group-data-[state=open]:rotate-180\"\n />\n )}\n </button>\n </DropdownMenuTrigger>\n {/* Expanded menus follow the trigger width so they stay inside the sidebar. */}\n <DropdownMenuContent\n align=\"start\"\n className={cn(\n 'border-0 max-w-[calc(100vw-1.5rem)]',\n variant === 'sidebar' && !compact\n ? 'w-[var(--radix-dropdown-menu-trigger-width)]'\n : 'w-60'\n )}\n data-testid={testIdOr(testIds?.menu, { testId: 'workspace-switcher-menu' })}\n >\n <DropdownMenuItem\n onClick={onGoToList}\n data-testid={testIdOr(testIds?.all, { testId: 'workspace-switcher-all' })}\n className=\"gap-2\"\n >\n <LayoutGrid className=\"size-4 flex-shrink-0 text-muted-foreground\" />\n {l.allWorkspaces(plural)}\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={newWorkspaceDisabledReason ? undefined : onNewWorkspace}\n disabled={!!newWorkspaceDisabledReason}\n title={newWorkspaceDisabledReason}\n data-testid={testIdOr(testIds?.new, { testId: 'workspace-switcher-new' })}\n className=\"gap-2\"\n >\n <Plus className=\"size-4 flex-shrink-0 text-muted-foreground\" />\n <span className=\"flex min-w-0 flex-col\">\n {l.newWorkspace(singular)}\n {newWorkspaceDisabledReason && (\n <span className=\"text-xs text-muted-foreground\">{newWorkspaceDisabledReason}</span>\n )}\n </span>\n </DropdownMenuItem>\n {recent.length > 0 && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuLabel className=\"text-xs font-normal text-muted-foreground\">\n {l.recentWorkspaces(plural)}\n </DropdownMenuLabel>\n {recent.map((w) => {\n const kind = workspaceKindMeta(w.kind, l)\n return (\n <DropdownMenuItem\n key={w.id}\n onClick={() => onSwitch(w)}\n data-testid={prefixedTestId(testIds?.switchItem, w.id, {\n testId: `workspace-switch-${w.id}`,\n })}\n className=\"gap-2\"\n >\n <span className=\"relative flex flex-shrink-0\" title={kind.label}>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'flex size-6 flex-shrink-0 items-center justify-center rounded text-xs font-semibold leading-none',\n kind.fill\n )}\n >\n {w.name.charAt(0).toUpperCase()}\n </span>\n <span className=\"absolute -bottom-1 -right-1 flex size-3 items-center justify-center rounded-full bg-background ring-1 ring-border\">\n <kind.Icon\n aria-label={kind.label}\n data-testid={prefixedTestId(testIds?.type, w.id, {\n testId: `workspace-type-${w.id}`,\n })}\n className=\"size-2 text-muted-foreground\"\n />\n </span>\n </span>\n <span className=\"min-w-0 flex-1 truncate capitalize\">{w.name}</span>\n {w.lastSeen && (\n <span\n className=\"ml-2 flex-shrink-0 text-xs tabular-nums text-muted-foreground\"\n data-testid={prefixedTestId(testIds?.lastSeen, w.id, {\n testId: `workspace-last-seen-${w.id}`,\n })}\n >\n {w.lastSeen}\n </span>\n )}\n </DropdownMenuItem>\n )\n })}\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","import { useRef, type ReactNode } from 'react'\nimport { Menu } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useShellBottomInset } from '../lib/bottom-inset'\nimport type { NavItem } from './types'\n\n/** Fixed strings of the phone bars. */\nexport interface MobileBarsLabels {\n /** The menu button (the `menuLabel` prop wins). */\n openNavigationMenu: string\n /** The tab bar's accessible name (the `label` prop wins). */\n workspaceSections: string\n}\n\nexport const DEFAULT_MOBILE_BARS_LABELS: MobileBarsLabels = {\n openNavigationMenu: 'Open navigation menu',\n workspaceSections: 'Workspace sections',\n}\n\nexport interface MobileAppBarProps {\n /** Show the menu button that opens the drawer (nothing to open on a list page with no sidebar). */\n showMenu?: boolean\n onMenu?: () => void\n /** Replaces the brand mark (e.g. the workspace switcher). */\n title?: ReactNode\n /** Brand mark shown when there is no `title`. */\n logo?: ReactNode\n /** Right-aligned controls that fit (ask, offline pill, bell, account). */\n actions?: ReactNode\n menuLabel?: string\n labels?: Partial<Pick<MobileBarsLabels, 'openNavigationMenu'>>\n className?: string\n 'data-testid'?: string\n /** Menu button id (default `mobile-nav-toggle`). */\n menuTestId?: string\n}\n\n/**\n * The slim phone app bar (56px): menu button, a title slot and an actions slot. The app mounts\n * it only on small screens; the controls that do not fit live in the drawer.\n */\nexport function MobileAppBar({\n showMenu = true,\n onMenu,\n title,\n logo,\n actions,\n menuLabel,\n labels,\n className,\n 'data-testid': testId,\n menuTestId,\n}: MobileAppBarProps) {\n return (\n <div\n data-slot=\"mobile-app-bar\"\n data-testid={testId}\n className={cn(\n 'sm:hidden flex h-14 flex-shrink-0 items-center gap-1 bg-background pl-1 pr-2 pt-safe',\n className\n )}\n >\n {showMenu && (\n <button\n type=\"button\"\n onClick={onMenu}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted\"\n aria-label={\n menuLabel ?? labels?.openNavigationMenu ?? DEFAULT_MOBILE_BARS_LABELS.openNavigationMenu\n }\n data-testid={testIdOr(menuTestId, { testId: 'mobile-nav-toggle' })}\n >\n <Menu className=\"size-5\" />\n </button>\n )}\n <div className={cn('flex min-w-0 flex-1 items-center', !showMenu && 'pl-3')}>\n {title ?? logo}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-0.5\">{actions}</div>}\n </div>\n )\n}\n\n/**\n * A tab's label. It wraps at word boundaries and is never clipped or cut with an ellipsis; a tab\n * narrower than 4.5rem sets it one size smaller so a long single word still fits, and an item with\n * a `shortLabel` shows that one while its tab is narrower than 5.5rem.\n */\nfunction TabLabel({ item }: { item: NavItem }) {\n const wrap =\n 'max-w-full text-balance px-0.5 text-center [overflow-wrap:normal] @max-[4.5rem]:text-[10px]'\n if (!item.shortLabel) return <span className={wrap}>{item.label}</span>\n return (\n <>\n <span data-slot=\"tab-short-label\" aria-hidden=\"true\" className={cn(wrap, '@[5.5rem]:hidden')}>\n {item.shortLabel}\n </span>\n <span className={cn(wrap, 'hidden @[5.5rem]:block')}>{item.label}</span>\n <span className=\"sr-only @[5.5rem]:hidden\">{item.label}</span>\n </>\n )\n}\n\nexport interface MobileTabBarProps {\n /** The workspace's main areas; test ids are `{testIdPrefix}-{id}` (prefix default `mobile-tab`). */\n items: NavItem[]\n label?: string\n labels?: Partial<Pick<MobileBarsLabels, 'workspaceSections'>>\n testIdPrefix?: string\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * Phone bottom navigation: a 64px tinted bar of the main areas. The drawer carries the same\n * destinations with counts, so nothing is reachable only here. The app mounts it on small\n * screens only.\n */\nexport function MobileTabBar({\n items,\n label,\n labels,\n testIdPrefix,\n className,\n 'data-testid': testId,\n}: MobileTabBarProps) {\n const navRef = useRef<HTMLElement>(null)\n // Floating elements (install prompt, toasts) read the bar's height from `--shell-bottom-inset`.\n useShellBottomInset(navRef)\n return (\n <nav\n ref={navRef}\n aria-label={\n label ?? labels?.workspaceSections ?? DEFAULT_MOBILE_BARS_LABELS.workspaceSections\n }\n data-slot=\"mobile-tab-bar\"\n data-testid={testIdOr(testId, { testId: 'mobile-tab-bar' })}\n className={cn(\n 'flex min-h-16 flex-shrink-0 items-stretch bg-sidebar px-2 pb-safe sm:hidden',\n className\n )}\n >\n {items.map((item) => (\n <ActionLink\n key={item.id}\n href={item.href}\n external={item.external}\n onSelect={item.onSelect}\n disabled={item.disabled}\n aria-current={item.active ? 'page' : undefined}\n className={cn(\n // Each tab is a size container: a `shortLabel` replaces the label when it is narrow.\n '@container flex min-h-12 min-w-0 flex-1 flex-col items-center justify-center gap-0.5 rounded-md text-[11px] leading-tight transition-colors',\n item.active\n ? 'font-semibold text-primary'\n : 'font-medium text-muted-foreground hover:text-foreground'\n )}\n data-testid={prefixedTestId(testIdPrefix, item.id, { testId: `mobile-tab-${item.id}` })}\n >\n {item.icon}\n <TabLabel item={item} />\n </ActionLink>\n ))}\n </nav>\n )\n}\n","/**\n * One policy for every automatic reload: when the running build is out of date, pick a moment\n * that costs the user nothing.\n *\n * After a deploy (or mid-rollout, while old and new pods both serve) the previous build's hashed\n * chunks can 404. Vite reports that as `vite:preloadError`. Reloading fetches the current\n * index.html (served no-cache) and its chunks, but reloading at once throws away whatever the\n * user is typing, so:\n *\n * - A failed prefetch (`prefetchChunk`) never reloads. Nothing on screen depends on it.\n * - A failed chunk the user is waiting for reloads at once, unless the user is on a sign-in form\n * or has unsaved input (a focused or edited field, or a `[data-reload-guard]` region).\n * - Otherwise the reload waits: the next route navigation becomes a full page load of its target,\n * or the page reloads once the user is idle with nothing unsaved.\n * - Per tab, at most one policy reload a minute. A second failure right after one is not a stale\n * build (a genuinely missing chunk, say), so it surfaces to the error boundary instead of looping.\n */\n\nimport { notify } from '@arbidocs/react/shell'\n\nexport const CHUNK_RELOAD_KEY = 'arbi_chunk_reload_at'\n\n/** A second failure within this window after a reload is not a stale build: let it surface. */\nconst RELOAD_GUARD_MS = 60_000\n/** A deferred reload waits until the user has done nothing for this long. */\nconst IDLE_MS = 10_000\nconst IDLE_CHECK_MS = 2_000\n\n/** Sign-in pages, and regions a host marks as holding unsaved work. */\nconst GUARD_SELECTOR =\n '[data-slot=\"auth-layout\"], input[type=\"password\"], input[autocomplete=\"one-time-code\"], [data-reload-guard]'\nconst NON_TEXT_INPUTS = new Set([\n 'button',\n 'submit',\n 'reset',\n 'checkbox',\n 'radio',\n 'hidden',\n 'range',\n 'color',\n 'file',\n 'image',\n])\n\nexport interface ReloadPolicyDeps {\n /** Reload the current page. */\n reload: () => void\n /** Full page load of `url` (instead of a client-side navigation). */\n load: (url: string, replace: boolean) => void\n now: () => number\n}\n\nconst browserDeps: ReloadPolicyDeps = {\n reload: () => window.location.reload(),\n load: (url, replace) => (replace ? window.location.replace(url) : window.location.assign(url)),\n now: () => Date.now(),\n}\n\nlet deps = browserDeps\nlet installed = false\n/** The build is out of date: the next route navigation loads the page fresh. */\nlet stale = false\n/** A chunk the user needed failed: reload as soon as nothing would be lost. */\nlet reloadWanted = false\nlet lastActivity = 0\nlet idleTimer: ReturnType<typeof setInterval> | undefined\nlet restoreNavigation: (() => void) | null = null\n/** Fields the user typed into. */\nconst edited = new Set<Element>()\n/** Errors from `prefetchChunk` loads, so the preload-error handler can tell them apart. */\nconst prefetchFailures = new WeakSet<object>()\n\nfunction isTextField(el: Element): boolean {\n if (el instanceof HTMLInputElement) return !NON_TEXT_INPUTS.has(el.type)\n return el instanceof HTMLTextAreaElement || (el as HTMLElement).isContentEditable === true\n}\n\nfunction hasText(el: Element): boolean {\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {\n return el.value.trim() !== ''\n }\n return (el.textContent ?? '').trim() !== ''\n}\n\n/**\n * Whether reloading now could cost the user something: a sign-in form, a `[data-reload-guard]`\n * region, a focused text field, or a field they typed into that still holds text.\n */\nexport function hasUnsavedInput(doc: Document = document): boolean {\n if (doc.querySelector(GUARD_SELECTOR)) return true\n const active = doc.activeElement\n if (active && active !== doc.body && isTextField(active)) return true\n for (const el of edited) {\n if (!el.isConnected) edited.delete(el)\n else if (hasText(el)) return true\n }\n return false\n}\n\n/** Take this tab's reload slot. False within the guard window, or when storage can't record it. */\nfunction claimReload(): boolean {\n const now = deps.now()\n let last = 0\n try {\n last = Number(sessionStorage.getItem(CHUNK_RELOAD_KEY)) || 0\n } catch {\n // Unreadable: treat as never reloaded. Writing below decides.\n }\n if (last && now - last < RELOAD_GUARD_MS) return false\n try {\n sessionStorage.setItem(CHUNK_RELOAD_KEY, String(now))\n } catch {\n // Without the guard we can't tell a loop from a stale build: don't risk one.\n return false\n }\n return true\n}\n\nfunction guardHot(): boolean {\n try {\n const last = Number(sessionStorage.getItem(CHUNK_RELOAD_KEY)) || 0\n return !!last && deps.now() - last < RELOAD_GUARD_MS\n } catch {\n return false\n }\n}\n\nfunction settle(): void {\n stale = false\n reloadWanted = false\n if (idleTimer !== undefined) clearInterval(idleTimer)\n idleTimer = undefined\n restoreNavigation?.()\n restoreNavigation = null\n}\n\nfunction reloadNow(): boolean {\n if (!claimReload()) {\n settle()\n return false\n }\n settle()\n deps.reload()\n return true\n}\n\n/** A client-side navigation to `url` becomes a full page load of it while the build is stale. */\nfunction loadsFresh(url: string | URL | null | undefined): string | null {\n if (!stale || url == null) return null\n const target = new URL(String(url), window.location.href)\n if (target.pathname === window.location.pathname) return null\n // Leaving a sign-in page establishes the session: a full load there races its persistence.\n if (document.querySelector(GUARD_SELECTOR)) return null\n return target.href\n}\n\nfunction interceptNavigation(): void {\n if (restoreNavigation) return\n const history = window.history\n const push = history.pushState\n const replace = history.replaceState\n let shownPath = window.location.pathname\n const wrap = (original: History['pushState'], replaceEntry: boolean): History['pushState'] =>\n function (this: History, data, unused, url) {\n const target = loadsFresh(url)\n if (target && claimReload()) {\n settle()\n deps.load(target, replaceEntry)\n return\n }\n original.call(this, data, unused, url)\n shownPath = window.location.pathname\n }\n history.pushState = wrap(push, false)\n history.replaceState = wrap(replace, true)\n // Back/forward already changed the address: reloading loads that target.\n const onPopState = () => {\n if (window.location.pathname === shownPath) return\n shownPath = window.location.pathname\n if (!document.querySelector(GUARD_SELECTOR)) reloadNow()\n }\n window.addEventListener('popstate', onPopState)\n restoreNavigation = () => {\n history.pushState = push\n history.replaceState = replace\n window.removeEventListener('popstate', onPopState)\n }\n}\n\nfunction watchForIdle(): void {\n if (idleTimer !== undefined) return\n idleTimer = setInterval(() => {\n if (!reloadWanted) return\n const idle = document.visibilityState === 'hidden' || deps.now() - lastActivity >= IDLE_MS\n if (idle && !hasUnsavedInput()) reloadNow()\n }, IDLE_CHECK_MS)\n}\n\n/**\n * The running build is out of date (a chunk 404'd, or a new service worker took over): the next\n * route navigation loads its target fresh instead of rendering it client-side.\n */\nexport function markBuildStale(): void {\n stale = true\n interceptNavigation()\n}\n\nexport type ReloadOutcome = 'reloaded' | 'deferred' | 'guarded'\n\n/**\n * Reload onto the current build when nothing would be lost; otherwise defer to the next route\n * navigation or to the moment the user is idle with nothing unsaved. `guarded` means a policy\n * reload just happened in this tab, so the failure should surface instead.\n */\nexport function requestReload(): ReloadOutcome {\n if (guardHot()) return 'guarded'\n if (!hasUnsavedInput()) return reloadNow() ? 'reloaded' : 'guarded'\n reloadWanted = true\n markBuildStale()\n watchForIdle()\n return 'deferred'\n}\n\n/**\n * Load a chunk ahead of need (warming a route the user may open next). Never rejects, and a\n * failure never reloads the page: it only marks the build stale so the next navigation loads\n * fresh.\n */\nexport function prefetchChunk(load: () => Promise<unknown>): Promise<void> {\n let loading: Promise<unknown>\n try {\n loading = load()\n } catch (error) {\n loading = Promise.reject(error)\n }\n return loading.then(\n () => undefined,\n (error: unknown) => {\n if (typeof error === 'object' && error !== null) prefetchFailures.add(error)\n }\n )\n}\n\nfunction decide(payload: unknown): void {\n const prefetch = typeof payload === 'object' && payload !== null && prefetchFailures.has(payload)\n // Offline the chunk simply couldn't be downloaded (it isn't cached yet). Reloading can't fix\n // that and would throw away what's on screen; say what happened instead, and let the failed\n // import reach the nearest error boundary as usual.\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n if (!prefetch) {\n notify.warning(\"This part of ARBI isn't available offline yet\", {\n description: 'Reconnect to open it. Once you have, it will work offline too.',\n })\n }\n return\n }\n markBuildStale()\n if (prefetch) return\n const outcome = requestReload()\n console.warn(`[chunk] A code chunk failed to load (stale build?): ${outcome}`, payload)\n}\n\n/**\n * The `vite:preloadError` handler. Decides once the failed import's own handlers have run, so a\n * `prefetchChunk` failure is known as one. Never cancels the event: the import rejects as usual\n * and, if a reload follows, the page is replaced anyway.\n */\nexport function handleChunkLoadError(event: Event): void {\n const payload = (event as Event & { payload?: unknown }).payload\n setTimeout(() => decide(payload), 0)\n}\n\nfunction onActivity(event: Event): void {\n lastActivity = deps.now()\n if (event.type === 'input' && event.target instanceof Element && isTextField(event.target)) {\n edited.add(event.target)\n }\n}\n\nconst ACTIVITY_EVENTS = ['input', 'keydown', 'pointerdown', 'wheel', 'touchstart'] as const\n\n/** Install the reload policy. Call once at startup; later calls are no-ops. */\nexport function installReloadPolicy(overrides: Partial<ReloadPolicyDeps> = {}): void {\n deps = { ...browserDeps, ...overrides }\n if (installed || typeof window === 'undefined') return\n installed = true\n lastActivity = deps.now()\n window.addEventListener('vite:preloadError', handleChunkLoadError)\n for (const type of ACTIVITY_EVENTS) {\n document.addEventListener(type, onActivity, { capture: true, passive: true })\n }\n}\n\n/** Undo `installReloadPolicy` and forget all state (tests). */\nexport function resetReloadPolicy(): void {\n settle()\n edited.clear()\n if (installed) {\n window.removeEventListener('vite:preloadError', handleChunkLoadError)\n for (const type of ACTIVITY_EVENTS) document.removeEventListener(type, onActivity, true)\n }\n installed = false\n deps = browserDeps\n}\n"]}
1
+ {"version":3,"sources":["../src/shell/Workspace.tsx","../src/shell/MobileBars.tsx","../src/shell/reload-policy.ts"],"names":["Globe","Users","Lock","jsxs","jsx","testIdOr","cn","Fragment","DropdownMenu","DropdownMenuTrigger","ChevronDown","DropdownMenuContent","DropdownMenuItem","LayoutGrid","Plus","DropdownMenuSeparator","DropdownMenuLabel","prefixedTestId","Menu","useRef","useShellBottomInset","ActionLink","notify"],"mappings":";;;;;;;;;;;AAqBO,IAAM,6BAAA,GAAqD;AAAA,EAChE,MAAA,EAAQ,QAAA;AAAA,EACR,MAAA,EAAQ,QAAA;AAAA,EACR,OAAA,EAAS;AACX;AAQO,SAAS,iBAAA,CACd,MACA,MAAA,EAKA;AACA,EAAA,MAAM,CAAA,GAAI,EAAE,GAAG,6BAAA,EAA+B,GAAG,MAAA,EAAO;AACxD,EAAA,IAAI,IAAA,KAAS,QAAA;AACX,IAAA,OAAO,EAAE,IAAA,EAAMA,iBAAA,EAAO,OAAO,CAAA,CAAE,MAAA,EAAQ,MAAM,gCAAA,EAAiC;AAChF,EAAA,IAAI,IAAA,KAAS,QAAA;AACX,IAAA,OAAO,EAAE,IAAA,EAAMC,iBAAA,EAAO,OAAO,CAAA,CAAE,MAAA,EAAQ,MAAM,wCAAA,EAAyC;AACxF,EAAA,OAAO,EAAE,IAAA,EAAMC,gBAAA,EAAM,OAAO,CAAA,CAAE,OAAA,EAAS,MAAM,oCAAA,EAAqC;AACpF;AAGO,SAAS,mBAAmB,IAAA,EAAkC;AACnE,EAAA,IAAI,IAAA,KAAS,UAAU,OAAO,+BAAA;AAC9B,EAAA,IAAI,IAAA,KAAS,UAAU,OAAO,wBAAA;AAC9B,EAAA,OAAO,sBAAA;AACT;AAsBO,SAAS,iBAAA,CAAkB;AAAA,EAChC,SAAA;AAAA,EACA,QAAA;AAAA,EACA,QAAA,GAAW,KAAA;AAAA,EACX,MAAA;AAAA,EACA;AACF,CAAA,EAA2B;AACzB,EAAA,MAAM,IAAA,GAAO,iBAAA,CAAkB,SAAA,CAAU,IAAA,EAAM,MAAM,CAAA;AACrD,EAAA,MAAM,wBACJC,eAAA,CAAC,MAAA,EA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AAA,EAAoB;AACvD,EAAA,MAAM,UAAW,KAAA,CAAwC,OAAA;AACzD,EAAA,UAAA,CAAW,MAAM,MAAA,CAAO,OAAO,CAAA,EAAG,CAAC,CAAA;AACrC;AAEA,SAAS,WAAW,KAAA,EAAoB;AACtC,EAAA,YAAA,GAAe,KAAK,GAAA,EAAI;AACxB,EAAA,IAAI,KAAA,CAAM,SAAS,OAAA,IAAW,KAAA,CAAM,kBAAkB,OAAA,IAAW,WAAA,CAAY,KAAA,CAAM,MAAM,CAAA,EAAG;AAC1F,IAAA,MAAA,CAAO,GAAA,CAAI,MAAM,MAAM,CAAA;AAAA,EACzB;AACF;AAEA,IAAM,kBAAkB,CAAC,OAAA,EAAS,SAAA,EAAW,aAAA,EAAe,SAAS,YAAY,CAAA;AAG1E,SAAS,mBAAA,CAAoB,SAAA,GAAuC,EAAC,EAAS;AACnF,EAAA,IAAA,GAAO,EAAE,GAAG,WAAA,EAAa,GAAG,SAAA,EAAU;AACtC,EAAA,IAAI,SAAA,IAAa,OAAO,MAAA,KAAW,WAAA,EAAa;AAChD,EAAA,SAAA,GAAY,IAAA;AACZ,EAAA,YAAA,GAAe,KAAK,GAAA,EAAI;AACxB,EAAA,MAAA,CAAO,gBAAA,CAAiB,qBAAqB,oBAAoB,CAAA;AACjE,EAAA,KAAA,MAAW,QAAQ,eAAA,EAAiB;AAClC,IAAA,QAAA,CAAS,gBAAA,CAAiB,MAAM,UAAA,EAAY,EAAE,SAAS,IAAA,EAAM,OAAA,EAAS,MAAM,CAAA;AAAA,EAC9E;AACF","file":"chunk-7HU2NQVO.cjs","sourcesContent":["import type { ComponentType } from 'react'\nimport { ChevronDown, Globe, LayoutGrid, Lock, Plus, Users } from 'lucide-react'\nimport {\n cn,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@arbidocs/react/ui'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport type { ShellRecentWorkspace, ShellWorkspace, ShellWorkspaceKind } from './types'\n\n/** The three workspace-kind names (badge title, type glyph name, subtitle). */\nexport interface WorkspaceKindLabels {\n common: string\n shared: string\n private: string\n}\n\nexport const DEFAULT_WORKSPACE_KIND_LABELS: WorkspaceKindLabels = {\n common: 'Common',\n shared: 'Shared',\n private: 'Private',\n}\n\n/**\n * Workspace type drives the initial-badge fill and a quiet secondary glyph:\n * private (just you) -> navy, lock shared (several) -> selection tint, people\n * common (public) -> neutral, globe\n * Navy is identity and cyan is reserved for ARBI/AI, so \"shared\" is the selection tint.\n */\nexport function workspaceKindMeta(\n kind: ShellWorkspaceKind,\n labels?: Partial<WorkspaceKindLabels>\n): {\n Icon: ComponentType<{ className?: string; 'aria-label'?: string; 'data-testid'?: string }>\n label: string\n fill: string\n} {\n const l = { ...DEFAULT_WORKSPACE_KIND_LABELS, ...labels }\n if (kind === 'common')\n return { Icon: Globe, label: l.common, fill: 'bg-muted text-muted-foreground' }\n if (kind === 'shared')\n return { Icon: Users, label: l.shared, fill: 'bg-secondary text-secondary-foreground' }\n return { Icon: Lock, label: l.private, fill: 'bg-primary text-primary-foreground' }\n}\n\n/** The kind's hue as a CSS colour, for glyphs painted by SVG fill (the workspace shield). */\nexport function workspaceKindColor(kind: ShellWorkspaceKind): string {\n if (kind === 'common') return 'var(--color-muted-foreground)'\n if (kind === 'shared') return 'var(--color-secondary)'\n return 'var(--color-primary)'\n}\n\n/** Overridable ids of the workspace identity; defaults are the current ids. */\ntype WorkspaceIdentityTestIds = Partial<Record<'initial' | 'type' | 'projectName', string>>\n\nexport interface WorkspaceIdentityProps {\n workspace: ShellWorkspace\n /** Show name + type/project line beside the badge; otherwise the badge alone. */\n expanded: boolean\n /** Selected (nav-row) styling of the name. */\n isActive?: boolean\n /** Reword the kind names. */\n labels?: Partial<WorkspaceKindLabels>\n /** Part ids; defaults are the current ids. */\n testIds?: WorkspaceIdentityTestIds\n}\n\n/**\n * Non-interactive guts of the workspace head: the initial badge (with a tiny type glyph) and,\n * when expanded, the name and the project/type line. Hosted by the switcher trigger and by the\n * workspace settings header, so it never nests a button.\n */\nexport function WorkspaceIdentity({\n workspace,\n expanded,\n isActive = false,\n labels,\n testIds,\n}: WorkspaceIdentityProps) {\n const kind = workspaceKindMeta(workspace.kind, labels)\n const badge = (\n <span className=\"relative flex flex-shrink-0\" title={kind.label}>\n <span\n aria-hidden=\"true\"\n data-testid={testIdOr(testIds?.initial, { testId: 'sidebar-workspace-card-initial' })}\n className={cn(\n 'flex size-7 flex-shrink-0 items-center justify-center rounded-md text-sm font-semibold leading-none',\n kind.fill\n )}\n >\n {workspace.name.charAt(0).toUpperCase()}\n </span>\n {/* Type as a tiny overlay on the badge: status reads at the icon, not after the name. */}\n <span className=\"absolute -bottom-1 -right-1 flex size-3.5 items-center justify-center rounded-full bg-background ring-1 ring-border\">\n <kind.Icon\n aria-label={kind.label}\n data-testid={testIdOr(testIds?.type, { testId: 'sidebar-workspace-card-type' })}\n className=\"size-2.5 text-muted-foreground\"\n />\n </span>\n </span>\n )\n\n if (!expanded)\n return <div className=\"flex flex-shrink-0 items-center justify-center\">{badge}</div>\n\n return (\n <>\n <div className=\"flex flex-shrink-0 items-center justify-center\">{badge}</div>\n <div className=\"ml-2.5 flex min-w-0 flex-1 flex-col text-left\">\n <span\n // 600: the name of the thing you are inside, above a lighter project line.\n className={cn(\n 'min-w-0 truncate text-left text-sm font-semibold capitalize leading-tight transition-colors duration-100',\n isActive ? 'text-accent-foreground' : 'text-foreground'\n )}\n >\n {workspace.name}\n </span>\n {!workspace.projectName && (\n <span className=\"mt-0.5 truncate text-xs text-muted-foreground\">{kind.label}</span>\n )}\n {workspace.projectName && (\n <span\n className=\"mt-0.5 flex min-w-0\"\n data-testid={testIdOr(testIds?.projectName, {\n testId: 'sidebar-workspace-card-project-name',\n })}\n >\n {workspace.projectLine ?? (\n <span className=\"truncate text-xs text-muted-foreground\">\n {workspace.projectName}\n </span>\n )}\n </span>\n )}\n </div>\n </>\n )\n}\n\n/**\n * Entity nouns plus the switcher's strings. `plural` arrives lowercased and `singular`\n * capitalized in the functions below.\n */\nexport interface WorkspaceSwitcherLabels extends WorkspaceKindLabels {\n /** Entity nouns, e.g. { plural: 'workspaces', singular: 'workspace' }. */\n plural: string\n singular: string\n /** The trigger's accessible name. */\n switchWorkspace: (name: string, plural: string) => string\n allWorkspaces: (plural: string) => string\n newWorkspace: (singular: string) => string\n recentWorkspaces: (plural: string) => string\n}\n\nexport const DEFAULT_WORKSPACE_SWITCHER_LABELS: WorkspaceSwitcherLabels = {\n ...DEFAULT_WORKSPACE_KIND_LABELS,\n plural: 'workspaces',\n singular: 'workspace',\n switchWorkspace: (name, plural) => `${name} — switch ${plural}`,\n allWorkspaces: (plural) => `All ${plural}`,\n newWorkspace: (singular) => `New ${singular}`,\n recentWorkspaces: (plural) => `Recent ${plural}`,\n}\n\nexport interface WorkspaceSwitcherProps {\n workspace: ShellWorkspace\n /** Other workspaces to jump to (the app orders and caps them). */\n recent?: ShellRecentWorkspace[]\n /** Icon-only trigger (the sidebar rail). */\n compact?: boolean\n /** `appbar`: the phone app bar's title, name + chevron on one line. */\n variant?: 'sidebar' | 'appbar'\n onSwitch: (workspace: ShellWorkspace) => void\n /** Return to the workspaces list; leaves the workspace open. */\n onGoToList: () => void\n onNewWorkspace: () => void\n /**\n * When set, \"New workspace\" is shown disabled with this explanation under it (e.g. the user may\n * not create workspaces on this deployment).\n */\n newWorkspaceDisabledReason?: string\n /** Entity nouns and menu strings; any subset (the nouns default to workspace(s)). */\n labels?: Partial<WorkspaceSwitcherLabels>\n className?: string\n /** Trigger id (default `workspace-switcher-trigger`). */\n testId?: string\n /**\n * Part ids; defaults are the current ids. `switchItem`, `type` and `lastSeen` are prefixes\n * (`<prefix>-<workspace id>`).\n */\n testIds?: Partial<Record<'menu' | 'all' | 'new' | 'switchItem' | 'type' | 'lastSeen', string>>\n /** Ids forwarded to the trigger's workspace identity. */\n identityTestIds?: WorkspaceIdentityTestIds\n}\n\n/**\n * The current-workspace control as a dropdown: \"All workspaces\", \"New workspace\", then the\n * recent workspaces to jump straight into.\n */\nexport function WorkspaceSwitcher({\n workspace,\n recent = [],\n compact = false,\n variant = 'sidebar',\n onSwitch,\n onGoToList,\n onNewWorkspace,\n newWorkspaceDisabledReason,\n labels,\n className,\n testId,\n testIds,\n identityTestIds,\n}: WorkspaceSwitcherProps) {\n const l = { ...DEFAULT_WORKSPACE_SWITCHER_LABELS, ...labels }\n const plural = l.plural.toLowerCase()\n const singular = l.singular.charAt(0).toUpperCase() + l.singular.slice(1)\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n data-slot=\"workspace-switcher\"\n data-testid={testIdOr(testId, { testId: 'workspace-switcher-trigger' })}\n aria-label={l.switchWorkspace(workspace.name, plural)}\n className={cn(\n 'group flex min-w-0 items-center rounded-md transition-colors duration-100 hover:bg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n variant === 'appbar'\n ? 'h-11 max-w-full gap-1 px-2'\n : compact\n ? 'h-12 w-12 justify-center'\n : 'h-12 w-full px-2',\n className\n )}\n >\n {variant === 'appbar' ? (\n <span className=\"min-w-0 truncate text-base font-semibold text-foreground\">\n {workspace.name}\n </span>\n ) : (\n <WorkspaceIdentity\n workspace={workspace}\n expanded={!compact}\n labels={l}\n testIds={identityTestIds}\n />\n )}\n {!(compact && variant === 'sidebar') && (\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ml-auto size-4 flex-shrink-0 text-muted-foreground transition-transform duration-150 group-data-[state=open]:rotate-180\"\n />\n )}\n </button>\n </DropdownMenuTrigger>\n {/* Expanded menus follow the trigger width so they stay inside the sidebar. */}\n <DropdownMenuContent\n align=\"start\"\n className={cn(\n 'border-0 max-w-[calc(100vw-1.5rem)]',\n variant === 'sidebar' && !compact\n ? 'w-[var(--radix-dropdown-menu-trigger-width)]'\n : 'w-60'\n )}\n data-testid={testIdOr(testIds?.menu, { testId: 'workspace-switcher-menu' })}\n >\n <DropdownMenuItem\n onClick={onGoToList}\n data-testid={testIdOr(testIds?.all, { testId: 'workspace-switcher-all' })}\n className=\"gap-2\"\n >\n <LayoutGrid className=\"size-4 flex-shrink-0 text-muted-foreground\" />\n {l.allWorkspaces(plural)}\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={newWorkspaceDisabledReason ? undefined : onNewWorkspace}\n disabled={!!newWorkspaceDisabledReason}\n title={newWorkspaceDisabledReason}\n data-testid={testIdOr(testIds?.new, { testId: 'workspace-switcher-new' })}\n className=\"gap-2\"\n >\n <Plus className=\"size-4 flex-shrink-0 text-muted-foreground\" />\n <span className=\"flex min-w-0 flex-col\">\n {l.newWorkspace(singular)}\n {newWorkspaceDisabledReason && (\n <span className=\"text-xs text-muted-foreground\">{newWorkspaceDisabledReason}</span>\n )}\n </span>\n </DropdownMenuItem>\n {recent.length > 0 && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuLabel className=\"text-xs font-normal text-muted-foreground\">\n {l.recentWorkspaces(plural)}\n </DropdownMenuLabel>\n {recent.map((w) => {\n const kind = workspaceKindMeta(w.kind, l)\n return (\n <DropdownMenuItem\n key={w.id}\n onClick={() => onSwitch(w)}\n data-testid={prefixedTestId(testIds?.switchItem, w.id, {\n testId: `workspace-switch-${w.id}`,\n })}\n className=\"gap-2\"\n >\n <span className=\"relative flex flex-shrink-0\" title={kind.label}>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'flex size-6 flex-shrink-0 items-center justify-center rounded text-xs font-semibold leading-none',\n kind.fill\n )}\n >\n {w.name.charAt(0).toUpperCase()}\n </span>\n <span className=\"absolute -bottom-1 -right-1 flex size-3 items-center justify-center rounded-full bg-background ring-1 ring-border\">\n <kind.Icon\n aria-label={kind.label}\n data-testid={prefixedTestId(testIds?.type, w.id, {\n testId: `workspace-type-${w.id}`,\n })}\n className=\"size-2 text-muted-foreground\"\n />\n </span>\n </span>\n <span className=\"min-w-0 flex-1 truncate capitalize\">{w.name}</span>\n {w.lastSeen && (\n <span\n className=\"ml-2 flex-shrink-0 text-xs tabular-nums text-muted-foreground\"\n data-testid={prefixedTestId(testIds?.lastSeen, w.id, {\n testId: `workspace-last-seen-${w.id}`,\n })}\n >\n {w.lastSeen}\n </span>\n )}\n </DropdownMenuItem>\n )\n })}\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","import { useRef, type ReactNode } from 'react'\nimport { Menu } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useShellBottomInset } from '../lib/bottom-inset'\nimport type { NavItem } from './types'\n\n/** Fixed strings of the phone bars. */\nexport interface MobileBarsLabels {\n /** The menu button (the `menuLabel` prop wins). */\n openNavigationMenu: string\n /** The tab bar's accessible name (the `label` prop wins). */\n workspaceSections: string\n}\n\nexport const DEFAULT_MOBILE_BARS_LABELS: MobileBarsLabels = {\n openNavigationMenu: 'Open navigation menu',\n workspaceSections: 'Workspace sections',\n}\n\nexport interface MobileAppBarProps {\n /** Show the menu button that opens the drawer (nothing to open on a list page with no sidebar). */\n showMenu?: boolean\n onMenu?: () => void\n /** Replaces the brand mark (e.g. the workspace switcher). */\n title?: ReactNode\n /** Brand mark shown when there is no `title`. */\n logo?: ReactNode\n /** Right-aligned controls that fit (ask, offline pill, bell, account). */\n actions?: ReactNode\n menuLabel?: string\n labels?: Partial<Pick<MobileBarsLabels, 'openNavigationMenu'>>\n className?: string\n 'data-testid'?: string\n /** Menu button id (default `mobile-nav-toggle`). */\n menuTestId?: string\n}\n\n/**\n * The slim phone app bar (56px): menu button, a title slot and an actions slot. The app mounts\n * it only on small screens; the controls that do not fit live in the drawer.\n */\nexport function MobileAppBar({\n showMenu = true,\n onMenu,\n title,\n logo,\n actions,\n menuLabel,\n labels,\n className,\n 'data-testid': testId,\n menuTestId,\n}: MobileAppBarProps) {\n return (\n <div\n data-slot=\"mobile-app-bar\"\n data-testid={testId}\n className={cn(\n 'sm:hidden flex h-14 flex-shrink-0 items-center gap-1 bg-background pl-1 pr-2 pt-safe',\n className\n )}\n >\n {showMenu && (\n <button\n type=\"button\"\n onClick={onMenu}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted\"\n aria-label={\n menuLabel ?? labels?.openNavigationMenu ?? DEFAULT_MOBILE_BARS_LABELS.openNavigationMenu\n }\n data-testid={testIdOr(menuTestId, { testId: 'mobile-nav-toggle' })}\n >\n <Menu className=\"size-5\" />\n </button>\n )}\n <div className={cn('flex min-w-0 flex-1 items-center', !showMenu && 'pl-3')}>\n {title ?? logo}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-0.5\">{actions}</div>}\n </div>\n )\n}\n\n/**\n * A tab's label. It wraps at word boundaries and is never clipped or cut with an ellipsis; a tab\n * narrower than 4.5rem sets it one size smaller so a long single word still fits, and an item with\n * a `shortLabel` shows that one while its tab is narrower than 5.5rem.\n */\nfunction TabLabel({ item }: { item: NavItem }) {\n const wrap =\n 'max-w-full text-balance px-0.5 text-center [overflow-wrap:normal] @max-[4.5rem]:text-[10px]'\n if (!item.shortLabel) return <span className={wrap}>{item.label}</span>\n return (\n <>\n <span data-slot=\"tab-short-label\" aria-hidden=\"true\" className={cn(wrap, '@[5.5rem]:hidden')}>\n {item.shortLabel}\n </span>\n <span className={cn(wrap, 'hidden @[5.5rem]:block')}>{item.label}</span>\n <span className=\"sr-only @[5.5rem]:hidden\">{item.label}</span>\n </>\n )\n}\n\nexport interface MobileTabBarProps {\n /** The workspace's main areas; test ids are `{testIdPrefix}-{id}` (prefix default `mobile-tab`). */\n items: NavItem[]\n label?: string\n labels?: Partial<Pick<MobileBarsLabels, 'workspaceSections'>>\n testIdPrefix?: string\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * Phone bottom navigation: a 64px tinted bar of the main areas. The drawer carries the same\n * destinations with counts, so nothing is reachable only here. The app mounts it on small\n * screens only.\n */\nexport function MobileTabBar({\n items,\n label,\n labels,\n testIdPrefix,\n className,\n 'data-testid': testId,\n}: MobileTabBarProps) {\n const navRef = useRef<HTMLElement>(null)\n // Floating elements (install prompt, toasts) read the bar's height from `--shell-bottom-inset`.\n useShellBottomInset(navRef)\n return (\n <nav\n ref={navRef}\n aria-label={\n label ?? labels?.workspaceSections ?? DEFAULT_MOBILE_BARS_LABELS.workspaceSections\n }\n data-slot=\"mobile-tab-bar\"\n data-testid={testIdOr(testId, { testId: 'mobile-tab-bar' })}\n className={cn(\n 'flex min-h-16 flex-shrink-0 items-stretch bg-sidebar px-2 pb-safe sm:hidden',\n className\n )}\n >\n {items.map((item) => (\n <ActionLink\n key={item.id}\n href={item.href}\n external={item.external}\n onSelect={item.onSelect}\n disabled={item.disabled}\n aria-current={item.active ? 'page' : undefined}\n className={cn(\n // Each tab is a size container: a `shortLabel` replaces the label when it is narrow.\n '@container flex min-h-12 min-w-0 flex-1 flex-col items-center justify-center gap-0.5 rounded-md text-[11px] leading-tight transition-colors',\n item.active\n ? 'font-semibold text-primary'\n : 'font-medium text-muted-foreground hover:text-foreground'\n )}\n data-testid={prefixedTestId(testIdPrefix, item.id, { testId: `mobile-tab-${item.id}` })}\n >\n {item.icon}\n <TabLabel item={item} />\n </ActionLink>\n ))}\n </nav>\n )\n}\n","/**\n * One policy for every automatic reload: when the running build is out of date, pick a moment\n * that costs the user nothing.\n *\n * After a deploy (or mid-rollout, while old and new pods both serve) the previous build's hashed\n * chunks can 404. Vite reports that as `vite:preloadError`. Reloading fetches the current\n * index.html (served no-cache) and its chunks, but reloading at once throws away whatever the\n * user is typing, so:\n *\n * - A failed prefetch (`prefetchChunk`) never reloads. Nothing on screen depends on it.\n * - A failed chunk the user is waiting for reloads at once, unless the user is on a sign-in form\n * or has unsaved input (a focused or edited field, or a `[data-reload-guard]` region).\n * - Otherwise the reload waits: the next route navigation becomes a full page load of its target,\n * or the page reloads once the user is idle with nothing unsaved.\n * - Per tab, at most one policy reload a minute. A second failure right after one is not a stale\n * build (a genuinely missing chunk, say), so it surfaces to the error boundary instead of looping.\n */\n\nimport { notify } from '@arbidocs/react/shell'\n\nexport const CHUNK_RELOAD_KEY = 'arbi_chunk_reload_at'\n\n/** A second failure within this window after a reload is not a stale build: let it surface. */\nconst RELOAD_GUARD_MS = 60_000\n/** A deferred reload waits until the user has done nothing for this long. */\nconst IDLE_MS = 10_000\nconst IDLE_CHECK_MS = 2_000\n\n/** Sign-in pages, and regions a host marks as holding unsaved work. */\nconst GUARD_SELECTOR =\n '[data-slot=\"auth-layout\"], input[type=\"password\"], input[autocomplete=\"one-time-code\"], [data-reload-guard]'\nconst NON_TEXT_INPUTS = new Set([\n 'button',\n 'submit',\n 'reset',\n 'checkbox',\n 'radio',\n 'hidden',\n 'range',\n 'color',\n 'file',\n 'image',\n])\n\nexport interface ReloadPolicyDeps {\n /** Reload the current page. */\n reload: () => void\n /** Full page load of `url` (instead of a client-side navigation). */\n load: (url: string, replace: boolean) => void\n now: () => number\n}\n\nconst browserDeps: ReloadPolicyDeps = {\n reload: () => window.location.reload(),\n load: (url, replace) => (replace ? window.location.replace(url) : window.location.assign(url)),\n now: () => Date.now(),\n}\n\nlet deps = browserDeps\nlet installed = false\n/** The build is out of date: the next route navigation loads the page fresh. */\nlet stale = false\n/** A chunk the user needed failed: reload as soon as nothing would be lost. */\nlet reloadWanted = false\nlet lastActivity = 0\nlet idleTimer: ReturnType<typeof setInterval> | undefined\nlet restoreNavigation: (() => void) | null = null\n/** Fields the user typed into. */\nconst edited = new Set<Element>()\n/** Errors from `prefetchChunk` loads, so the preload-error handler can tell them apart. */\nconst prefetchFailures = new WeakSet<object>()\n\nfunction isTextField(el: Element): boolean {\n if (el instanceof HTMLInputElement) return !NON_TEXT_INPUTS.has(el.type)\n return el instanceof HTMLTextAreaElement || (el as HTMLElement).isContentEditable === true\n}\n\nfunction hasText(el: Element): boolean {\n if (el instanceof HTMLInputElement || el instanceof HTMLTextAreaElement) {\n return el.value.trim() !== ''\n }\n return (el.textContent ?? '').trim() !== ''\n}\n\n/**\n * Whether reloading now could cost the user something: a sign-in form, a `[data-reload-guard]`\n * region, a focused text field, or a field they typed into that still holds text.\n */\nexport function hasUnsavedInput(doc: Document = document): boolean {\n if (doc.querySelector(GUARD_SELECTOR)) return true\n const active = doc.activeElement\n if (active && active !== doc.body && isTextField(active)) return true\n for (const el of edited) {\n if (!el.isConnected) edited.delete(el)\n else if (hasText(el)) return true\n }\n return false\n}\n\n/** Take this tab's reload slot. False within the guard window, or when storage can't record it. */\nfunction claimReload(): boolean {\n const now = deps.now()\n let last = 0\n try {\n last = Number(sessionStorage.getItem(CHUNK_RELOAD_KEY)) || 0\n } catch {\n // Unreadable: treat as never reloaded. Writing below decides.\n }\n if (last && now - last < RELOAD_GUARD_MS) return false\n try {\n sessionStorage.setItem(CHUNK_RELOAD_KEY, String(now))\n } catch {\n // Without the guard we can't tell a loop from a stale build: don't risk one.\n return false\n }\n return true\n}\n\nfunction guardHot(): boolean {\n try {\n const last = Number(sessionStorage.getItem(CHUNK_RELOAD_KEY)) || 0\n return !!last && deps.now() - last < RELOAD_GUARD_MS\n } catch {\n return false\n }\n}\n\nfunction settle(): void {\n stale = false\n reloadWanted = false\n if (idleTimer !== undefined) clearInterval(idleTimer)\n idleTimer = undefined\n restoreNavigation?.()\n restoreNavigation = null\n}\n\nfunction reloadNow(): boolean {\n if (!claimReload()) {\n settle()\n return false\n }\n settle()\n deps.reload()\n return true\n}\n\n/** A client-side navigation to `url` becomes a full page load of it while the build is stale. */\nfunction loadsFresh(url: string | URL | null | undefined): string | null {\n if (!stale || url == null) return null\n const target = new URL(String(url), window.location.href)\n if (target.pathname === window.location.pathname) return null\n // Leaving a sign-in page establishes the session: a full load there races its persistence.\n if (document.querySelector(GUARD_SELECTOR)) return null\n return target.href\n}\n\nfunction interceptNavigation(): void {\n if (restoreNavigation) return\n const history = window.history\n const push = history.pushState\n const replace = history.replaceState\n let shownPath = window.location.pathname\n const wrap = (original: History['pushState'], replaceEntry: boolean): History['pushState'] =>\n function (this: History, data, unused, url) {\n const target = loadsFresh(url)\n if (target && claimReload()) {\n settle()\n deps.load(target, replaceEntry)\n return\n }\n original.call(this, data, unused, url)\n shownPath = window.location.pathname\n }\n history.pushState = wrap(push, false)\n history.replaceState = wrap(replace, true)\n // Back/forward already changed the address: reloading loads that target.\n const onPopState = () => {\n if (window.location.pathname === shownPath) return\n shownPath = window.location.pathname\n if (!document.querySelector(GUARD_SELECTOR)) reloadNow()\n }\n window.addEventListener('popstate', onPopState)\n restoreNavigation = () => {\n history.pushState = push\n history.replaceState = replace\n window.removeEventListener('popstate', onPopState)\n }\n}\n\nfunction watchForIdle(): void {\n if (idleTimer !== undefined) return\n idleTimer = setInterval(() => {\n if (!reloadWanted) return\n const idle = document.visibilityState === 'hidden' || deps.now() - lastActivity >= IDLE_MS\n if (idle && !hasUnsavedInput()) reloadNow()\n }, IDLE_CHECK_MS)\n}\n\n/**\n * The running build is out of date (a chunk 404'd, or a new service worker took over): the next\n * route navigation loads its target fresh instead of rendering it client-side.\n */\nexport function markBuildStale(): void {\n stale = true\n interceptNavigation()\n}\n\nexport type ReloadOutcome = 'reloaded' | 'deferred' | 'guarded'\n\n/**\n * Reload onto the current build when nothing would be lost; otherwise defer to the next route\n * navigation or to the moment the user is idle with nothing unsaved. `guarded` means a policy\n * reload just happened in this tab, so the failure should surface instead.\n */\nexport function requestReload(): ReloadOutcome {\n if (guardHot()) return 'guarded'\n if (!hasUnsavedInput()) return reloadNow() ? 'reloaded' : 'guarded'\n reloadWanted = true\n markBuildStale()\n watchForIdle()\n return 'deferred'\n}\n\n/**\n * Load a chunk ahead of need (warming a route the user may open next). Never rejects, and a\n * failure never reloads the page: it only marks the build stale so the next navigation loads\n * fresh.\n */\nexport function prefetchChunk(load: () => Promise<unknown>): Promise<void> {\n let loading: Promise<unknown>\n try {\n loading = load()\n } catch (error) {\n loading = Promise.reject(error)\n }\n return loading.then(\n () => undefined,\n (error: unknown) => {\n if (typeof error === 'object' && error !== null) prefetchFailures.add(error)\n }\n )\n}\n\nfunction decide(payload: unknown): void {\n const prefetch = typeof payload === 'object' && payload !== null && prefetchFailures.has(payload)\n // Offline the chunk simply couldn't be downloaded (it isn't cached yet). Reloading can't fix\n // that and would throw away what's on screen; say what happened instead, and let the failed\n // import reach the nearest error boundary as usual.\n if (typeof navigator !== 'undefined' && navigator.onLine === false) {\n if (!prefetch) {\n notify.warning(\"This part of ARBI isn't available offline yet\", {\n description: 'Reconnect to open it. Once you have, it will work offline too.',\n })\n }\n return\n }\n markBuildStale()\n if (prefetch) return\n const outcome = requestReload()\n console.warn(`[chunk] A code chunk failed to load (stale build?): ${outcome}`, payload)\n}\n\n/**\n * The `vite:preloadError` handler. Decides once the failed import's own handlers have run, so a\n * `prefetchChunk` failure is known as one. Never cancels the event: the import rejects as usual\n * and, if a reload follows, the page is replaced anyway.\n */\nexport function handleChunkLoadError(event: Event): void {\n const payload = (event as Event & { payload?: unknown }).payload\n setTimeout(() => decide(payload), 0)\n}\n\nfunction onActivity(event: Event): void {\n lastActivity = deps.now()\n if (event.type === 'input' && event.target instanceof Element && isTextField(event.target)) {\n edited.add(event.target)\n }\n}\n\nconst ACTIVITY_EVENTS = ['input', 'keydown', 'pointerdown', 'wheel', 'touchstart'] as const\n\n/** Install the reload policy. Call once at startup; later calls are no-ops. */\nexport function installReloadPolicy(overrides: Partial<ReloadPolicyDeps> = {}): void {\n deps = { ...browserDeps, ...overrides }\n if (installed || typeof window === 'undefined') return\n installed = true\n lastActivity = deps.now()\n window.addEventListener('vite:preloadError', handleChunkLoadError)\n for (const type of ACTIVITY_EVENTS) {\n document.addEventListener(type, onActivity, { capture: true, passive: true })\n }\n}\n\n/** Undo `installReloadPolicy` and forget all state (tests). */\nexport function resetReloadPolicy(): void {\n settle()\n edited.clear()\n if (installed) {\n window.removeEventListener('vite:preloadError', handleChunkLoadError)\n for (const type of ACTIVITY_EVENTS) document.removeEventListener(type, onActivity, true)\n }\n installed = false\n deps = browserDeps\n}\n"]}
@@ -2,7 +2,7 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkINNHU46B_cjs = require('./chunk-INNHU46B.cjs');
5
- var chunkPI4U4LEN_cjs = require('./chunk-PI4U4LEN.cjs');
5
+ var chunkSDSK7RWP_cjs = require('./chunk-SDSK7RWP.cjs');
6
6
  var react = require('@arbidocs/react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
8
8
 
@@ -10,7 +10,7 @@ function ConnectedNativeDocxComparison({
10
10
  fontBaseUrl,
11
11
  ...props
12
12
  }) {
13
- const adapter = chunkPI4U4LEN_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
13
+ const adapter = chunkSDSK7RWP_cjs.useConnectedNativeDocxAdapter(fontBaseUrl);
14
14
  const { data: documents, isLoading } = react.useDocuments();
15
15
  const morePages = react.useDocumentsLoading();
16
16
  if (isLoading || morePages)
@@ -27,5 +27,5 @@ function ConnectedNativeDocxComparison({
27
27
  }
28
28
 
29
29
  exports.ConnectedNativeDocxComparison = ConnectedNativeDocxComparison;
30
- //# sourceMappingURL=chunk-Z6FJLJWX.cjs.map
31
- //# sourceMappingURL=chunk-Z6FJLJWX.cjs.map
30
+ //# sourceMappingURL=chunk-7KEB3VZ5.cjs.map
31
+ //# sourceMappingURL=chunk-7KEB3VZ5.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/docx/ConnectedNativeDocxComparison.tsx"],"names":["useConnectedNativeDocxAdapter","useDocuments","useDocumentsLoading","jsx","NativeDocxComparison"],"mappings":";;;;;;;AAYO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEG;AACD,EAAA,MAAM,OAAA,GAAUA,gDAA8B,WAAW,CAAA;AACzD,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,EAAW,SAAA,KAAcC,kBAAA,EAAa;AAEpD,EAAA,MAAM,YAAYC,yBAAA,EAAoB;AAEtC,EAAA,IAAI,SAAA,IAAa,SAAA;AACf,IAAA,sCACG,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EAAoB,IAAA,EAAK,UAAS,QAAA,EAAA,gCAAA,EAEjD,CAAA;AAEJ,EAAA,uBACEC,cAAA;AAAA,IAACC,sCAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,OAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAY,OAAA,CAAQ;AAAA;AAAA,GACtB;AAEJ","file":"chunk-Z6FJLJWX.cjs","sourcesContent":["import { useDocuments, useDocumentsLoading } from '@arbidocs/react'\nimport {\n NativeDocxComparison,\n type NativeDocxComparisonProps,\n} from '../../docx/NativeDocxComparison'\nimport { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\n\n/**\n * The Word redline of two documents or versions, on the signed-in session. The unedited redline\n * saved earlier from the same versions is opened again (found in the workspace's documents, once\n * all their pages are read), so opening a comparison saves at most one.\n */\nexport function ConnectedNativeDocxComparison({\n fontBaseUrl,\n ...props\n}: Omit<NativeDocxComparisonProps, 'adapter' | 'onCompared' | 'documents'> & {\n fontBaseUrl?: string\n}) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { data: documents, isLoading } = useDocuments()\n // Every page: the first holds only the oldest documents, and a redline is often newer.\n const morePages = useDocumentsLoading()\n // Until the documents are read, a saved redline can't be found: wait rather than save another.\n if (isLoading || morePages)\n return (\n <div className=\"native-docx-error\" role=\"status\">\n Comparing Word documents…\n </div>\n )\n return (\n <NativeDocxComparison\n {...props}\n adapter={adapter}\n documents={documents}\n onCompared={adapter.onVersionSaved}\n />\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/docx/ConnectedNativeDocxComparison.tsx"],"names":["useConnectedNativeDocxAdapter","useDocuments","useDocumentsLoading","jsx","NativeDocxComparison"],"mappings":";;;;;;;AAYO,SAAS,6BAAA,CAA8B;AAAA,EAC5C,WAAA;AAAA,EACA,GAAG;AACL,CAAA,EAEG;AACD,EAAA,MAAM,OAAA,GAAUA,gDAA8B,WAAW,CAAA;AACzD,EAAA,MAAM,EAAE,IAAA,EAAM,SAAA,EAAW,SAAA,KAAcC,kBAAA,EAAa;AAEpD,EAAA,MAAM,YAAYC,yBAAA,EAAoB;AAEtC,EAAA,IAAI,SAAA,IAAa,SAAA;AACf,IAAA,sCACG,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EAAoB,IAAA,EAAK,UAAS,QAAA,EAAA,gCAAA,EAEjD,CAAA;AAEJ,EAAA,uBACEC,cAAA;AAAA,IAACC,sCAAA;AAAA,IAAA;AAAA,MACE,GAAG,KAAA;AAAA,MACJ,OAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAY,OAAA,CAAQ;AAAA;AAAA,GACtB;AAEJ","file":"chunk-7KEB3VZ5.cjs","sourcesContent":["import { useDocuments, useDocumentsLoading } from '@arbidocs/react'\nimport {\n NativeDocxComparison,\n type NativeDocxComparisonProps,\n} from '../../docx/NativeDocxComparison'\nimport { useConnectedNativeDocxAdapter } from './ConnectedNativeDocxEditor'\n\n/**\n * The Word redline of two documents or versions, on the signed-in session. The unedited redline\n * saved earlier from the same versions is opened again (found in the workspace's documents, once\n * all their pages are read), so opening a comparison saves at most one.\n */\nexport function ConnectedNativeDocxComparison({\n fontBaseUrl,\n ...props\n}: Omit<NativeDocxComparisonProps, 'adapter' | 'onCompared' | 'documents'> & {\n fontBaseUrl?: string\n}) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { data: documents, isLoading } = useDocuments()\n // Every page: the first holds only the oldest documents, and a redline is often newer.\n const morePages = useDocumentsLoading()\n // Until the documents are read, a saved redline can't be found: wait rather than save another.\n if (isLoading || morePages)\n return (\n <div className=\"native-docx-error\" role=\"status\">\n Comparing Word documents…\n </div>\n )\n return (\n <NativeDocxComparison\n {...props}\n adapter={adapter}\n documents={documents}\n onCompared={adapter.onVersionSaved}\n />\n )\n}\n"]}