@arbidocs/blocks 0.5.13 → 0.5.15

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 (153) hide show
  1. package/dist/{ConnectedCallDock-T4E3JVQV.cjs → ConnectedCallDock-3EQOPJNT.cjs} +5 -5
  2. package/dist/{ConnectedCallDock-T4E3JVQV.cjs.map → ConnectedCallDock-3EQOPJNT.cjs.map} +1 -1
  3. package/dist/{ConnectedCallDock-QM2TY67C.js → ConnectedCallDock-ET7DL5PF.js} +4 -4
  4. package/dist/{ConnectedCallDock-QM2TY67C.js.map → ConnectedCallDock-ET7DL5PF.js.map} +1 -1
  5. package/dist/{ConnectedCallRoom-VT5Z5BFO.js → ConnectedCallRoom-QQMTM76E.js} +4 -4
  6. package/dist/{ConnectedCallRoom-VT5Z5BFO.js.map → ConnectedCallRoom-QQMTM76E.js.map} +1 -1
  7. package/dist/{ConnectedCallRoom-4SWU33XP.cjs → ConnectedCallRoom-TQ6LXQEQ.cjs} +5 -5
  8. package/dist/{ConnectedCallRoom-4SWU33XP.cjs.map → ConnectedCallRoom-TQ6LXQEQ.cjs.map} +1 -1
  9. package/dist/{ConnectedNativeDocxComparison-L2YQ2RHW.js → ConnectedNativeDocxComparison-5XYKZMXL.js} +10 -10
  10. package/dist/{ConnectedNativeDocxComparison-L2YQ2RHW.js.map → ConnectedNativeDocxComparison-5XYKZMXL.js.map} +1 -1
  11. package/dist/{ConnectedNativeDocxComparison-JPVXK6OZ.cjs → ConnectedNativeDocxComparison-I2ALQR2Y.cjs} +11 -11
  12. package/dist/{ConnectedNativeDocxComparison-JPVXK6OZ.cjs.map → ConnectedNativeDocxComparison-I2ALQR2Y.cjs.map} +1 -1
  13. package/dist/{ConnectedNativeDocxEditor-S3OBWGRN.js → ConnectedNativeDocxEditor-T4W74AD2.js} +9 -9
  14. package/dist/{ConnectedNativeDocxEditor-S3OBWGRN.js.map → ConnectedNativeDocxEditor-T4W74AD2.js.map} +1 -1
  15. package/dist/{ConnectedNativeDocxEditor-KURMLAOF.cjs → ConnectedNativeDocxEditor-XLRQVOB5.cjs} +11 -11
  16. package/dist/{ConnectedNativeDocxEditor-KURMLAOF.cjs.map → ConnectedNativeDocxEditor-XLRQVOB5.cjs.map} +1 -1
  17. package/dist/{ConnectedStreamedWordArtifact-SPM5P6MI.js → ConnectedStreamedWordArtifact-2JL7B5P6.js} +10 -10
  18. package/dist/ConnectedStreamedWordArtifact-2JL7B5P6.js.map +1 -0
  19. package/dist/{ConnectedStreamedWordArtifact-AO46WD7W.cjs → ConnectedStreamedWordArtifact-PQZJAHR7.cjs} +11 -11
  20. package/dist/ConnectedStreamedWordArtifact-PQZJAHR7.cjs.map +1 -0
  21. package/dist/agents/index.cjs +328 -328
  22. package/dist/agents/index.js +6 -6
  23. package/dist/calls/index.cjs +39 -39
  24. package/dist/calls/index.js +7 -7
  25. package/dist/{chunk-SYXJ3QOS.js → chunk-3B75YVZL.js} +3 -3
  26. package/dist/{chunk-SYXJ3QOS.js.map → chunk-3B75YVZL.js.map} +1 -1
  27. package/dist/{chunk-Q5QLV5SQ.js → chunk-4AAM6UQG.js} +3 -3
  28. package/dist/{chunk-Q5QLV5SQ.js.map → chunk-4AAM6UQG.js.map} +1 -1
  29. package/dist/{chunk-R6XPHQOS.js → chunk-4IMTH6Z4.js} +3 -3
  30. package/dist/{chunk-R6XPHQOS.js.map → chunk-4IMTH6Z4.js.map} +1 -1
  31. package/dist/{chunk-I45TWXAG.cjs → chunk-4MADJGGF.cjs} +4 -4
  32. package/dist/{chunk-I45TWXAG.cjs.map → chunk-4MADJGGF.cjs.map} +1 -1
  33. package/dist/{chunk-FUVUFFFA.js → chunk-4OLM7LQX.js} +3 -3
  34. package/dist/{chunk-FUVUFFFA.js.map → chunk-4OLM7LQX.js.map} +1 -1
  35. package/dist/{chunk-X24LIKQ7.cjs → chunk-5NEILZQR.cjs} +4 -4
  36. package/dist/{chunk-X24LIKQ7.cjs.map → chunk-5NEILZQR.cjs.map} +1 -1
  37. package/dist/{chunk-NFEROK3R.js → chunk-5QJDDEYV.js} +3 -3
  38. package/dist/{chunk-NFEROK3R.js.map → chunk-5QJDDEYV.js.map} +1 -1
  39. package/dist/{chunk-CKLG6B3L.js → chunk-5TALCIRH.js} +2 -2
  40. package/dist/{chunk-CKLG6B3L.js.map → chunk-5TALCIRH.js.map} +1 -1
  41. package/dist/{chunk-WGXUAHKD.cjs → chunk-6WX7ZMKL.cjs} +5 -5
  42. package/dist/{chunk-WGXUAHKD.cjs.map → chunk-6WX7ZMKL.cjs.map} +1 -1
  43. package/dist/{chunk-YTK5EU5U.js → chunk-7HCHMQOH.js} +3 -3
  44. package/dist/{chunk-YTK5EU5U.js.map → chunk-7HCHMQOH.js.map} +1 -1
  45. package/dist/{chunk-BGCGKHLZ.cjs → chunk-A6MGGHHN.cjs} +4 -4
  46. package/dist/{chunk-BGCGKHLZ.cjs.map → chunk-A6MGGHHN.cjs.map} +1 -1
  47. package/dist/{chunk-V576JOF4.js → chunk-AAWF27UG.js} +3 -3
  48. package/dist/{chunk-V576JOF4.js.map → chunk-AAWF27UG.js.map} +1 -1
  49. package/dist/{chunk-R65GBJUW.cjs → chunk-ATUPWVAL.cjs} +12 -12
  50. package/dist/{chunk-R65GBJUW.cjs.map → chunk-ATUPWVAL.cjs.map} +1 -1
  51. package/dist/{chunk-KD4N6F2F.cjs → chunk-AUDT4L2H.cjs} +4 -4
  52. package/dist/{chunk-KD4N6F2F.cjs.map → chunk-AUDT4L2H.cjs.map} +1 -1
  53. package/dist/{chunk-X56B2VGH.cjs → chunk-BZF6E46W.cjs} +2 -2
  54. package/dist/{chunk-X56B2VGH.cjs.map → chunk-BZF6E46W.cjs.map} +1 -1
  55. package/dist/{chunk-PQDKGPEL.js → chunk-DCQGJNZQ.js} +3 -3
  56. package/dist/{chunk-PQDKGPEL.js.map → chunk-DCQGJNZQ.js.map} +1 -1
  57. package/dist/{chunk-LPB2X4YD.cjs → chunk-DJ4BTWMA.cjs} +4 -4
  58. package/dist/{chunk-LPB2X4YD.cjs.map → chunk-DJ4BTWMA.cjs.map} +1 -1
  59. package/dist/{chunk-Z5222UQ2.js → chunk-E3RPCHU7.js} +3 -3
  60. package/dist/{chunk-Z5222UQ2.js.map → chunk-E3RPCHU7.js.map} +1 -1
  61. package/dist/{chunk-DIKG6SH3.js → chunk-EMNTZIMB.js} +6 -6
  62. package/dist/{chunk-DIKG6SH3.js.map → chunk-EMNTZIMB.js.map} +1 -1
  63. package/dist/{chunk-FUFPQBKR.cjs → chunk-F5A5346Z.cjs} +5 -4
  64. package/dist/chunk-F5A5346Z.cjs.map +1 -0
  65. package/dist/{chunk-SJX3IUEG.cjs → chunk-FJV72FP6.cjs} +5 -5
  66. package/dist/{chunk-SJX3IUEG.cjs.map → chunk-FJV72FP6.cjs.map} +1 -1
  67. package/dist/{chunk-E5N6MD5T.js → chunk-H626LRDN.js} +5 -5
  68. package/dist/{chunk-E5N6MD5T.js.map → chunk-H626LRDN.js.map} +1 -1
  69. package/dist/{chunk-QQRZQC4W.cjs → chunk-HHABG6MV.cjs} +14 -14
  70. package/dist/{chunk-QQRZQC4W.cjs.map → chunk-HHABG6MV.cjs.map} +1 -1
  71. package/dist/{chunk-UWRFHQGA.cjs → chunk-J3EXEAUA.cjs} +4 -4
  72. package/dist/{chunk-UWRFHQGA.cjs.map → chunk-J3EXEAUA.cjs.map} +1 -1
  73. package/dist/{chunk-DIPFR3EP.js → chunk-JUKF7YVT.js} +5 -5
  74. package/dist/{chunk-DIPFR3EP.js.map → chunk-JUKF7YVT.js.map} +1 -1
  75. package/dist/{chunk-KB5DESUR.js → chunk-LSGH6QA7.js} +4 -3
  76. package/dist/chunk-LSGH6QA7.js.map +1 -0
  77. package/dist/{chunk-OAH5IHX6.cjs → chunk-ML27HIMM.cjs} +6 -6
  78. package/dist/{chunk-OAH5IHX6.cjs.map → chunk-ML27HIMM.cjs.map} +1 -1
  79. package/dist/{chunk-4SKRNAWF.cjs → chunk-MWFSLLFX.cjs} +11 -11
  80. package/dist/{chunk-4SKRNAWF.cjs.map → chunk-MWFSLLFX.cjs.map} +1 -1
  81. package/dist/{chunk-H5PEFD2H.js → chunk-N7INPGON.js} +5 -5
  82. package/dist/{chunk-H5PEFD2H.js.map → chunk-N7INPGON.js.map} +1 -1
  83. package/dist/{chunk-RTHDSCCU.cjs → chunk-OHU27AJ4.cjs} +26 -26
  84. package/dist/{chunk-RTHDSCCU.cjs.map → chunk-OHU27AJ4.cjs.map} +1 -1
  85. package/dist/{chunk-DQNCUPIQ.js → chunk-OLBL2XNE.js} +3 -3
  86. package/dist/{chunk-DQNCUPIQ.js.map → chunk-OLBL2XNE.js.map} +1 -1
  87. package/dist/{chunk-G7RWVM2L.cjs → chunk-PBM6BFFH.cjs} +4 -4
  88. package/dist/{chunk-G7RWVM2L.cjs.map → chunk-PBM6BFFH.cjs.map} +1 -1
  89. package/dist/{chunk-WBM7VXTE.cjs → chunk-PE3RIWNX.cjs} +18 -18
  90. package/dist/{chunk-WBM7VXTE.cjs.map → chunk-PE3RIWNX.cjs.map} +1 -1
  91. package/dist/{chunk-AVBZWX6J.js → chunk-PSWTOD7E.js} +3 -3
  92. package/dist/{chunk-AVBZWX6J.js.map → chunk-PSWTOD7E.js.map} +1 -1
  93. package/dist/{chunk-UN4C2ORE.js → chunk-RG4SLXZG.js} +3 -3
  94. package/dist/{chunk-UN4C2ORE.js.map → chunk-RG4SLXZG.js.map} +1 -1
  95. package/dist/{chunk-VEKR5R6V.cjs → chunk-SWBD76UN.cjs} +9 -9
  96. package/dist/{chunk-VEKR5R6V.cjs.map → chunk-SWBD76UN.cjs.map} +1 -1
  97. package/dist/{chunk-WQGNQEEE.cjs → chunk-TDIC7IXS.cjs} +7 -7
  98. package/dist/{chunk-WQGNQEEE.cjs.map → chunk-TDIC7IXS.cjs.map} +1 -1
  99. package/dist/{chunk-EIAKSVBV.js → chunk-TRHAIU6U.js} +4 -4
  100. package/dist/{chunk-EIAKSVBV.js.map → chunk-TRHAIU6U.js.map} +1 -1
  101. package/dist/{chunk-MCVJLNGE.js → chunk-U32UNUEZ.js} +3 -3
  102. package/dist/{chunk-MCVJLNGE.js.map → chunk-U32UNUEZ.js.map} +1 -1
  103. package/dist/{chunk-ZZJ5XKG5.js → chunk-WINJF2AK.js} +3 -3
  104. package/dist/{chunk-ZZJ5XKG5.js.map → chunk-WINJF2AK.js.map} +1 -1
  105. package/dist/{chunk-CDFJOXTF.cjs → chunk-WT5AKLD4.cjs} +52 -52
  106. package/dist/{chunk-CDFJOXTF.cjs.map → chunk-WT5AKLD4.cjs.map} +1 -1
  107. package/dist/{chunk-NS6AZE6U.cjs → chunk-XF6TAXB5.cjs} +8 -8
  108. package/dist/{chunk-NS6AZE6U.cjs.map → chunk-XF6TAXB5.cjs.map} +1 -1
  109. package/dist/{chunk-55PLUQZF.cjs → chunk-XUWZMZP5.cjs} +5 -5
  110. package/dist/{chunk-55PLUQZF.cjs.map → chunk-XUWZMZP5.cjs.map} +1 -1
  111. package/dist/{chunk-JTVZZX2I.js → chunk-Y5HQUPRW.js} +3 -3
  112. package/dist/{chunk-JTVZZX2I.js.map → chunk-Y5HQUPRW.js.map} +1 -1
  113. package/dist/{chunk-6JHHWVFZ.cjs → chunk-Y7KDWKPZ.cjs} +7 -7
  114. package/dist/{chunk-6JHHWVFZ.cjs.map → chunk-Y7KDWKPZ.cjs.map} +1 -1
  115. package/dist/{chunk-HQ3B2RMV.js → chunk-ZBIKL6Q5.js} +6 -6
  116. package/dist/{chunk-HQ3B2RMV.js.map → chunk-ZBIKL6Q5.js.map} +1 -1
  117. package/dist/citations/index.cjs +10 -10
  118. package/dist/citations/index.js +2 -2
  119. package/dist/connect/docx.cjs +13 -13
  120. package/dist/connect/docx.js +9 -9
  121. package/dist/connect/index.cjs +701 -706
  122. package/dist/connect/index.cjs.map +1 -1
  123. package/dist/connect/index.js +30 -35
  124. package/dist/connect/index.js.map +1 -1
  125. package/dist/connect/viewer.cjs +77 -77
  126. package/dist/connect/viewer.js +12 -12
  127. package/dist/connection/storage/ConnectedStorageProjectCard.d.ts +1 -3
  128. package/dist/connection/storage/ConnectedStorageSettings.d.ts +1 -3
  129. package/dist/facts/index.cjs +3 -3
  130. package/dist/facts/index.js +2 -2
  131. package/dist/files/index.cjs +223 -223
  132. package/dist/files/index.js +3 -3
  133. package/dist/home/index.cjs +30 -30
  134. package/dist/home/index.js +5 -5
  135. package/dist/index.cjs +452 -452
  136. package/dist/index.js +13 -13
  137. package/dist/provider/environment.d.ts +2 -0
  138. package/dist/retrieval/index.cjs +4 -4
  139. package/dist/retrieval/index.js +2 -2
  140. package/dist/shell/index.cjs +46 -46
  141. package/dist/shell/index.js +3 -3
  142. package/dist/studio/index.cjs +13 -13
  143. package/dist/studio/index.js +5 -5
  144. package/dist/workflow-canvas/index.cjs +26 -26
  145. package/dist/workflow-canvas/index.js +8 -8
  146. package/dist/workspaces/index.cjs +20 -20
  147. package/dist/workspaces/index.js +4 -4
  148. package/node_modules/@arbidocs/coedit/package.json +1 -1
  149. package/package.json +5 -5
  150. package/dist/ConnectedStreamedWordArtifact-AO46WD7W.cjs.map +0 -1
  151. package/dist/ConnectedStreamedWordArtifact-SPM5P6MI.js.map +0 -1
  152. package/dist/chunk-FUFPQBKR.cjs.map +0 -1
  153. package/dist/chunk-KB5DESUR.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/connection/calendar/store.ts","../src/provider/dialogs.tsx","../src/provider/settings-section.ts","../src/provider/environment.ts"],"names":["request","resolve","notifyStore"],"mappings":";;;;;;;;;;AAqCO,IAAM,uBAAuB,MAAA,EAA0B;AAAA,EAC5D,OAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,oBAAoB,CAAC,eAAA,KAAoB,GAAA,CAAI,EAAE,iBAAiB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AS,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAK;AACrC,MAAA,IAAI,MAAA,EAAQ,wBAAA,CAAyB,OAAA,CAAQ,MAAM,CAAA;AAAA,IACrD,CAAC,CAAA,IAAK;AAAA,GACV;AACA,EAAA,QAAA,CAAS,IAAI,KAAK,CAAA;AAClB,EAAA,OAAO,KAAA;AACT;AAQO,SAAS,wBACd,WAAA,EACmB;AACnB,EAAA,IAAI,QAAA,CAAS,GAAA,CAAI,WAAgC,CAAA,EAAG,OAAO,WAAA;AAC3D,EAAA,IAAI,KAAA,GAAQ,QAAA,CAAS,GAAA,CAAI,WAAW,CAAA;AACpC,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,GAAA,CAAI,aAAc,KAAA,GAAQ,OAAA,CAAQ,WAAW,CAAE,CAAA;AACpE,EAAA,OAAO,KAAA;AACT;AAGO,SAAS,oBAAA,GAA0C;AACxD,EAAA,MAAM,WAAA,GAAc,qBAAoB,CAAE,WAAA;AAC1C,EAAA,OAAO,WAAA,GAAc,uBAAA,CAAwB,WAAW,CAAA,GAAI,kBAAA;AAC9D;AAMO,SAAS,eAAA,GAAqD;AACnE,EAAA,MAAM,EAAE,YAAA,EAAc,UAAA,EAAW,GAAI,oBAAA,EAAqB;AAC1D,EAAA,MAAM,OAAA,GAAU,WAAW,WAAW,CAAA;AACtC,EAAA,OAAO,UAAU,YAAA,GAAe,MAAA;AAClC","file":"chunk-CKLG6B3L.js","sourcesContent":["/**\n * The connected calendar's view state: the chosen view is remembered across reloads (localStorage),\n * the anchor date lives for the session, and two requests carry intents from elsewhere into the\n * calendar once it mounts: an event to open (a deep link, a reminder) and a prefilled new event\n * (\"Schedule a call\" from a thread). The host navigates to its calendar page after making one.\n */\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport type { CalendarViewKind } from '../../calendar/types'\n\n/** \"Schedule a call\" from elsewhere (a thread, a DM, a dashboard): the editor opens prefilled. */\nexport interface CalendarComposerPrefill {\n title?: string\n attendees?: { email?: string | null; user_id?: string | null; name?: string | null }[]\n conversationId?: string | null\n /** Add an ARBI call when the event is saved (\"Add ARBI call\" ticked). */\n addCall?: boolean\n}\n\nexport interface PendingCalendarEvent {\n id: string\n recurrenceId?: string | null\n}\n\ninterface CalendarViewState {\n /** `null` until the user picks one: the settings' default view applies. */\n view: CalendarViewKind | null\n /** YYYY-MM-DD anchor; `null` = today. */\n date: string | null\n pendingEvent: PendingCalendarEvent | null\n pendingComposer: CalendarComposerPrefill | null\n setPendingComposer: (prefill: CalendarComposerPrefill | null) => void\n setView: (view: CalendarViewKind) => void\n setDate: (date: string | null) => void\n setPendingEvent: (pending: PendingCalendarEvent | null) => void\n}\n\nexport const useCalendarViewStore = create<CalendarViewState>()(\n persist(\n (set) => ({\n view: null,\n date: null,\n pendingEvent: null,\n pendingComposer: null,\n setPendingComposer: (pendingComposer) => set({ pendingComposer }),\n setView: (view) => set({ view }),\n setDate: (date) => set({ date }),\n setPendingEvent: (pendingEvent) => set({ pendingEvent }),\n }),\n {\n name: 'arbi-calendar-view',\n storage: createJSONStorage(() => localStorage),\n partialize: (s) => ({ view: s.view }),\n }\n )\n)\n\nconst EVT_RE = /^evt-[A-Za-z0-9]{8}$/\n\n/** Ask the calendar to open on an event (ignored unless it is an `evt-` id). */\nexport function requestCalendarEvent(event: PendingCalendarEvent): void {\n if (EVT_RE.test(event.id)) useCalendarViewStore.getState().setPendingEvent(event)\n}\n\n/** Ask the calendar to open the event editor prefilled. */\nexport function requestCalendarComposer(prefill: CalendarComposerPrefill): void {\n useCalendarViewStore.getState().setPendingComposer(prefill)\n}\n","/**\n * Promise-based prompt dialogs — the blocks replacement for `window.confirm` / `window.alert`.\n * Each call mounts its own short-lived React root, so it works from any event handler with no\n * dialog host in the tree. Hosts reach these through `useBlocksEnvironment().confirm` / `.choose`\n * (the defaults), which lets an app swap in its own dialogs without touching callers.\n *\n * For a confirmation with a loading state, render the declarative {@link ConfirmDialog} instead.\n */\nimport { useState, type ReactElement } from 'react'\nimport { AlertCircle, Info } from 'lucide-react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../settings/ModalScaffold'\n\ntype ChoiceVariant = 'default' | 'destructive' | 'outline'\n\nexport interface PromptChoice<T extends string> {\n label: string\n value: T\n variant?: ChoiceVariant\n}\n\n/** A dialog offering arbitrary choices (e.g. Overwrite / Skip / Cancel). */\nexport interface ChoiceRequest<T extends string> {\n message: string\n title?: string\n choices: PromptChoice<T>[]\n icon?: 'alert' | 'info'\n /** Dialog test id; each button is `${testId}-${value}-button`. Default `choice-modal`. */\n testId?: string\n}\n\n/**\n * `confirm` — Cancel / Confirm (destructive); `yesno` — No / Yes; `alert` — a single OK\n * (resolves true once acknowledged).\n */\nexport type ConfirmKind = 'confirm' | 'yesno' | 'alert'\n\nexport interface ConfirmRequest {\n message: string\n /** Default: \"Alert\" for `alert`, else \"Confirm\". */\n title?: string\n kind?: ConfirmKind\n}\n\n/** Close animation length before the root is unmounted. */\nconst UNMOUNT_DELAY_MS = 300\n\nfunction PromptDialog<T extends string>({\n request,\n onSettle,\n}: {\n request: ChoiceRequest<T>\n onSettle: (value: T | null) => void\n}): ReactElement {\n const [open, setOpen] = useState(true)\n const { message, title = 'Confirm', choices, icon = 'alert', testId = 'choice-modal' } = request\n const settle = (value: T | null) => {\n setOpen(false)\n onSettle(value)\n }\n return (\n <ModalScaffold\n open={open}\n onOpenChange={(next) => {\n if (!next) settle(null)\n }}\n title={title}\n icon={\n icon === 'info' ? (\n <Info className=\"h-5 w-5 text-blue-text\" aria-hidden=\"true\" />\n ) : (\n <AlertCircle className=\"h-5 w-5\" aria-hidden=\"true\" />\n )\n }\n description={<span className=\"whitespace-pre-line\">{message}</span>}\n showDescription\n testId={testId}\n >\n <ModalScaffold.Footer>\n {choices.map((choice) => (\n <Button\n key={choice.value}\n variant={choice.variant ?? 'default'}\n onClick={() => settle(choice.value)}\n data-testid={`${testId}-${choice.value.toLowerCase()}-button`}\n >\n {choice.label}\n </Button>\n ))}\n </ModalScaffold.Footer>\n </ModalScaffold>\n )\n}\n\n/** Show a choice dialog; resolves with the chosen `value`, or `null` when dismissed. */\nexport function choiceDialog<T extends string>(request: ChoiceRequest<T>): Promise<T | null> {\n if (typeof document === 'undefined') return Promise.resolve(null)\n return new Promise((resolve) => {\n const container = document.createElement('div')\n document.body.appendChild(container)\n let settled = false\n void import('react-dom/client').then(({ createRoot }) => {\n const root = createRoot(container)\n const onSettle = (value: T | null) => {\n if (settled) return\n settled = true\n resolve(value)\n setTimeout(() => {\n root.unmount()\n container.remove()\n }, UNMOUNT_DELAY_MS)\n }\n root.render(<PromptDialog request={request} onSettle={onSettle} />)\n })\n })\n}\n\nconst CONFIRM_CHOICES: Record<\n ConfirmKind,\n PromptChoice<'confirm' | 'cancel' | 'yes' | 'no' | 'ok'>[]\n> = {\n confirm: [\n { label: 'Cancel', value: 'cancel', variant: 'outline' },\n { label: 'Confirm', value: 'confirm', variant: 'destructive' },\n ],\n yesno: [\n { label: 'No', value: 'no', variant: 'outline' },\n { label: 'Yes', value: 'yes' },\n ],\n alert: [{ label: 'OK', value: 'ok' }],\n}\n\nconst CONFIRM_TEST_ID: Record<ConfirmKind, string> = {\n confirm: 'confirmation-modal',\n yesno: 'yes-no-modal',\n alert: 'alert-modal',\n}\n\n/** Show a confirmation; resolves true on Confirm / Yes / OK, false on cancel or dismissal. */\nexport async function confirmDialog(request: ConfirmRequest): Promise<boolean> {\n const kind = request.kind ?? 'confirm'\n const choice = await choiceDialog({\n message: request.message,\n title: request.title ?? (kind === 'alert' ? 'Alert' : 'Confirm'),\n choices: CONFIRM_CHOICES[kind],\n icon: kind === 'alert' ? 'info' : 'alert',\n testId: CONFIRM_TEST_ID[kind],\n })\n return choice === 'confirm' || choice === 'yes' || choice === 'ok'\n}\n","/**\n * The settings section asked for last, so `openSettings(section)` opens that section in every host.\n *\n * `BlocksEnvironment.openSettings` records the section here before the host shows its settings\n * (a panel, a route); a `ConnectedSettingsPage` without its own `section` prop opens at it and\n * follows every later request, even one for the section asked for before. A host that keeps the\n * open section itself (`section` + `onSectionChange`) routes `openSettings` to its own state.\n */\nimport { useSyncExternalStore } from 'react'\n\nexport interface SettingsSectionRequest {\n section: string\n /** Increases with every request, so asking again for the same section is a new request. */\n seq: number\n}\n\nlet request: SettingsSectionRequest | undefined\nconst listeners = new Set<() => void>()\n\n/** Ask for a settings section; no section asks for none (the page stays where it is). */\nexport function requestSettingsSection(section?: string): void {\n if (!section) return\n request = { section, seq: (request?.seq ?? 0) + 1 }\n listeners.forEach((listener) => listener())\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\nconst snapshot = () => request\n\n/** The last settings-section request (`undefined` until there is one). */\nexport function useRequestedSettingsSection(): SettingsSectionRequest | undefined {\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n","import type { ReactNode } from 'react'\nimport {\n notify as notifyStore,\n useHostConfigRecord,\n type NotifyOptions,\n type NotifyVariant,\n} from '@arbidocs/react/shell'\nimport type { BlockLinkComponent } from '../components/blockLink'\nimport { requestCalendarEvent, type PendingCalendarEvent } from '../connection/calendar/store'\nimport { choiceDialog, confirmDialog, type ChoiceRequest, type ConfirmRequest } from './dialogs'\nimport { conversationStartRequest, mailDraftRequest } from './requests'\nimport { requestSettingsSection } from './settings-section'\n\n/** What blocks need from the host's runtime configuration (the app's `config.json`). */\nexport interface BlocksRuntimeConfig {\n /** Origin of the ARBI API; `''` means the page's own origin. */\n apiBaseUrl: string\n /** The deployment's domain, e.g. `www.arbidocs.com` (deep links, key derivation, labels). */\n deploymentDomain: string\n}\n\nexport interface OpenDocumentOptions {\n /** 1-based page to scroll to. */\n page?: number\n /** Passage (chunk) to highlight. */\n passageId?: string\n /**\n * The workspace the document is in, when it is not the open one (a document an agent wrote in\n * its own workspace): the host opens that workspace first.\n */\n workspaceId?: string\n /** An earlier version (1-based); none: the current one. */\n version?: number\n /** The viewer tab to show: `pdf` is where a signature request is reviewed and signed. */\n tab?: 'pdf'\n}\n\nexport interface OpenWordEditorOptions {\n /** The comment to show (a mention in it, a reply to it). */\n commentId?: string\n /** The workspace the document is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenConversationOptions {\n /** The message to scroll to. */\n messageId?: string\n /** The open document stays on screen beside the thread (a thread about it). */\n keepDocumentOpen?: boolean\n /** The workspace the thread is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenNewConversationOptions {\n /** Its first message, sent once the new conversation is ready (an ask bar, \"Ask about this\"). */\n prompt?: string\n /** The open document stays on screen beside it (a chat started from it). */\n keepDocumentOpen?: boolean\n}\n\nexport interface OpenWorkflowOptions {\n /** The workflow's editor (default) or its runs. */\n view?: 'builder' | 'runs'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** Parts of the product a host can turn off (a setting, a plan): a kit offers them only when on. */\nexport type BlocksFeature = 'workflows'\n\n/** Where files are added from: this device, links, or an email account. */\nexport type UploadSource = 'computer' | 'internet' | 'email'\n\n/** What `openShare` shares by email. */\nexport interface ShareRequest {\n resourceType: 'document' | 'conversation'\n resourceExtId: string\n workspaceExtId: string\n resourceName?: string\n /** Whether it is private to its owner now: the dialog offers to share it with the workspace. */\n isPrivate: boolean\n}\n\n/** What `openFiles` shows: some files selected, and the list narrowed. */\nexport interface OpenFilesOptions {\n /** Files to select. */\n select?: string[]\n /** Quick filters by key (a label id, `folder:<path>`, `folder:none`): show or hide those files. */\n filters?: Record<string, 'include' | 'exclude'>\n}\n\n/**\n * Something a kit links to (the target of an `open…` intent), for `hrefFor`. `workspaceId` is the\n * workspace it is in, when the kit knows it.\n */\nexport type LinkTarget =\n | { kind: 'document'; documentId: string; workspaceId?: string | null }\n | {\n kind: 'conversation'\n conversationId: string\n workspaceId?: string | null\n messageId?: string\n }\n | { kind: 'workspace'; workspaceId: string }\n /** A project; none: the projects list. */\n | { kind: 'project'; projectId?: string }\n /** A workflow (its editor); none: the workflows list. */\n | { kind: 'workflow'; workflowId?: string; workspaceId?: string | null }\n /** The mailbox, on an email draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The user's settings, at a section when given. */\n | { kind: 'settings'; section?: string }\n /** The calendar, on an event when given. */\n | { kind: 'calendar'; eventId?: string }\n\n/**\n * The only way blocks reach the host app's environment: the host configuration's `environment`\n * (`<ArbiHost config={{ environment: { navigate, notify, … } }}>`). Blocks never import a router, a\n * toast library or an app store; the host gives what it has, and every field has a safe default so\n * a block renders correctly with no host at all. A nested host overrides only the fields it gives\n * and inherits the rest.\n */\nexport interface BlocksEnvironment {\n /** Router-aware link (keeps navigation in-SPA). Default: a plain `<a href>`. */\n linkComponent?: BlockLinkComponent\n /** Imperative navigation for buttons and keyboard shortcuts. Default: `window.location.assign`. */\n navigate: (href: string) => void\n /** Surface a transient message (and record it in the notification centre). Default: the shared\n * `@arbidocs/react` notify store, rendered by its `<Toaster/>`. */\n notify: (message: ReactNode, kind?: NotifyVariant, options?: NotifyOptions) => void\n /** Ask the user to confirm. Default: the blocks prompt dialog. */\n confirm: (request: ConfirmRequest) => Promise<boolean>\n /** Ask the user to pick one of several choices; `null` when dismissed. Default: the blocks\n * prompt dialog. */\n choose: <T extends string>(request: ChoiceRequest<T>) => Promise<T | null>\n /** Deployment configuration. Default: same-origin API on the page's own host. */\n runtimeConfig: BlocksRuntimeConfig\n /**\n * The address of a target in the host's router, for a real link (open in a new tab, middle-click,\n * copy link) beside the matching `open…` intent: a kit never builds an app path itself, so its\n * links and its navigation agree on every site. `undefined`: no link (the row still opens on a\n * click). Default: none. ARBI-style paths (`/wrk-…/doc-…`): `deepLinkHref`.\n */\n hrefFor: (target: LinkTarget) => string | undefined\n /** Open a document (optionally at a page / passage) wherever the host shows documents.\n * Default: no-op. */\n openDocument: (documentId: string, options?: OpenDocumentOptions) => void\n /**\n * Open a Word document (`opensInWord`) in the host's Word editor, optionally on a comment.\n * Default: `openDocument` (a host whose viewer edits Word documents in place needs no other).\n */\n openWordEditor: (documentId: string, options?: OpenWordEditorOptions) => void\n /** Open a conversation thread, optionally scrolled to a message. Default: no-op. */\n openConversation: (conversationId: string, options?: OpenConversationOptions) => void\n /**\n * Show a new, empty conversation, unbound to any document. With a `prompt` it is sent as the\n * first message once the conversation is ready (recorded for the chat that shows it:\n * `ConnectedConversation`, `ChatPage`). Without one a launch composes into the session's draft\n * after this. Default: no-op.\n */\n openNewConversation: (options?: OpenNewConversationOptions) => void\n /**\n * Open the user's settings, optionally at a section (a `ConnectedSettingsPage` section id).\n * The section is always recorded for `ConnectedSettingsPage` first (`requestSettingsSection`);\n * the host's handler then shows its settings. Default: only that record.\n */\n openSettings: (section?: string) => void\n /** Open a project; no id: the projects list. Default: no-op. */\n openProject: (projectId?: string) => void\n /**\n * Show the calendar page (`ConnectedCalendar`), optionally on an event (recorded for the\n * calendar first: `requestCalendarEvent`). Default: only that record.\n */\n openCalendar: (options?: OpenCalendarOptions) => void\n /**\n * Show the mailbox (`ConnectedMailbox`), optionally on an email draft (recorded for the mailbox\n * first). Absent: the host has no mail, and a kit offers no way to open it.\n */\n openMail?: (options?: OpenMailOptions) => void\n /** Show the host's calls page (call history, scheduled calls). Absent: not offered. */\n openCalls?: () => void\n /** Show the host's notification centre (`ConnectedNotificationCenter`). Absent: not offered. */\n openNotifications?: () => void\n /**\n * Open a workflow in the host's Workflows page (its editor, or its runs); no id: the list.\n * Offered only while the `workflows` feature is on (`useOpenWorkflow`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * A React hook: whether a part of the product is on for this user (a setting, a plan). Kits\n * offer what is off nowhere. Default: everything is on.\n */\n useFeature: (feature: BlocksFeature) => boolean\n /** Show the open workspace's files, optionally with some selected and the list narrowed. Default: no-op. */\n openFiles: (options?: OpenFilesOptions) => void\n /**\n * Add files the host's way (its upload dialog), optionally with some already picked, or from one\n * source. Absent: a kit that adds files uploads them itself.\n */\n openUpload?: (files?: File[], options?: { source?: UploadSource }) => void\n /** Open the host's skills browser, optionally at one skill. Absent: not offered. */\n openSkillsBrowser?: (skillSlug?: string) => void\n /** Share a document or a thread by email (the host's share dialog). Absent: not offered. */\n openShare?: (request: ShareRequest) => void\n /**\n * Show a workspace (its own page). Under `defaultHost`'s sign-in layer the kits select it first\n * (`useConnectedWorkspace().openWorkspace`); a host that keeps its own session switches to it\n * here. `name` is for the host's messages. Default: no-op.\n */\n openWorkspace: (workspaceId: string, options?: { name?: string }) => void\n}\n\nconst noop = () => {}\n\nconst defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\n runtimeConfig: {\n apiBaseUrl: '',\n deploymentDomain: typeof window !== 'undefined' ? window.location.host : '',\n },\n hrefFor: () => undefined,\n openDocument: noop,\n openWordEditor: noop,\n openConversation: noop,\n openNewConversation: noop,\n openSettings: requestSettingsSection,\n openProject: noop,\n openCalendar: (options) => {\n if (options?.event) requestCalendarEvent(options.event)\n },\n useFeature: () => true,\n openFiles: noop,\n openWorkspace: noop,\n}\n\nconst resolved = new WeakMap<object, BlocksEnvironment>()\nconst complete = new WeakSet<BlocksEnvironment>()\n// The intents below that record what they open on: a resolved environment passed on again (a\n// nested host's, `createBlocksEnvironment`'s) records once, not twice.\nconst recording = new WeakSet<object>()\n\nfunction records<F extends object>(intent: F): F {\n recording.add(intent)\n return intent\n}\n\nfunction recordingIntent<F extends object>(\n host: F | undefined,\n wrap: (host: F) => F\n): F | undefined {\n if (!host) return undefined\n return recording.has(host) ? host : records(wrap(host))\n}\n\nfunction resolve(environment: Partial<BlocksEnvironment>): BlocksEnvironment {\n const { openDocument } = environment\n const value: BlocksEnvironment = {\n ...defaultEnvironment,\n openWordEditor: openDocument\n ? (documentId, options) => openDocument(documentId, { workspaceId: options?.workspaceId })\n : noop,\n ...environment,\n // What an intent opens on is recorded for the surface before the host shows it.\n openSettings:\n recordingIntent(environment.openSettings, (openSettings) => (section) => {\n requestSettingsSection(section)\n openSettings(section)\n }) ?? defaultEnvironment.openSettings,\n openCalendar:\n recordingIntent(environment.openCalendar, (openCalendar) => (options) => {\n defaultEnvironment.openCalendar(options)\n openCalendar(options)\n }) ?? defaultEnvironment.openCalendar,\n openMail: recordingIntent(environment.openMail, (openMail) => (options) => {\n if (options?.draftId) mailDraftRequest.request(options.draftId)\n openMail(options)\n }),\n openNewConversation:\n recordingIntent(environment.openNewConversation, (openNewConversation) => (options) => {\n openNewConversation(options)\n // After the host's reset of the new conversation, which clears its draft.\n const prompt = options?.prompt?.trim()\n if (prompt) conversationStartRequest.request(prompt)\n }) ?? noop,\n }\n complete.add(value)\n return value\n}\n\n/**\n * The environment with every field filled in (the defaults where `environment` gives none), and\n * every intent recording what it opens on. A host calls it for code outside React (a store action,\n * a notification handler); passing the result as the host configuration's `environment` uses it\n * as is.\n */\nexport function createBlocksEnvironment(\n environment: Partial<BlocksEnvironment>\n): BlocksEnvironment {\n if (complete.has(environment as BlocksEnvironment)) return environment as BlocksEnvironment\n let value = resolved.get(environment)\n if (!value) resolved.set(environment, (value = resolve(environment)))\n return value\n}\n\n/** The host's environment, every field filled in (the defaults where the host gives none). */\nexport function useBlocksEnvironment(): BlocksEnvironment {\n const environment = useHostConfigRecord().environment as Partial<BlocksEnvironment> | undefined\n return environment ? createBlocksEnvironment(environment) : defaultEnvironment\n}\n\n/**\n * How to open a workflow in the host's Workflows page, or `undefined` while there is none (the\n * host has no `openWorkflow`, or the `workflows` feature is off).\n */\nexport function useOpenWorkflow(): BlocksEnvironment['openWorkflow'] {\n const { openWorkflow, useFeature } = useBlocksEnvironment()\n const enabled = useFeature('workflows')\n return enabled ? openWorkflow : undefined\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/calendar/store.ts","../src/provider/dialogs.tsx","../src/provider/settings-section.ts","../src/provider/environment.ts"],"names":["request","resolve","notifyStore"],"mappings":";;;;;;;;;;AAqCO,IAAM,uBAAuB,MAAA,EAA0B;AAAA,EAC5D,OAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,oBAAoB,CAAC,eAAA,KAAoB,GAAA,CAAI,EAAE,iBAAiB,CAAA;AAAA,MAChE,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc;AAAA,KACzD,CAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,oBAAA;AAAA,MACN,OAAA,EAAS,iBAAA,CAAkB,MAAM,YAAY,CAAA;AAAA,MAC7C,YAAY,CAAC,CAAA,MAAO,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA;AACrC;AAEJ;AAEA,IAAM,MAAA,GAAS,sBAAA;AAGR,SAAS,qBAAqB,KAAA,EAAmC;AACtE,EAAA,IAAI,MAAA,CAAO,KAAK,KAAA,CAAM,EAAE,GAAG,oBAAA,CAAqB,QAAA,EAAS,CAAE,eAAA,CAAgB,KAAK,CAAA;AAClF;AAGO,SAAS,wBAAwB,OAAA,EAAwC;AAC9E,EAAA,oBAAA,CAAqB,QAAA,EAAS,CAAE,kBAAA,CAAmB,OAAO,CAAA;AAC5D;ACtBA,IAAM,gBAAA,GAAmB,GAAA;AAEzB,SAAS,YAAA,CAA+B;AAAA,EACtC,OAAA,EAAAA,QAAAA;AAAA,EACA;AACF,CAAA,EAGiB;AACf,EAAA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AAU,YAAA,GAAe,MAAA;AAClC","file":"chunk-5TALCIRH.js","sourcesContent":["/**\n * The connected calendar's view state: the chosen view is remembered across reloads (localStorage),\n * the anchor date lives for the session, and two requests carry intents from elsewhere into the\n * calendar once it mounts: an event to open (a deep link, a reminder) and a prefilled new event\n * (\"Schedule a call\" from a thread). The host navigates to its calendar page after making one.\n */\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport type { CalendarViewKind } from '../../calendar/types'\n\n/** \"Schedule a call\" from elsewhere (a thread, a DM, a dashboard): the editor opens prefilled. */\nexport interface CalendarComposerPrefill {\n title?: string\n attendees?: { email?: string | null; user_id?: string | null; name?: string | null }[]\n conversationId?: string | null\n /** Add an ARBI call when the event is saved (\"Add ARBI call\" ticked). */\n addCall?: boolean\n}\n\nexport interface PendingCalendarEvent {\n id: string\n recurrenceId?: string | null\n}\n\ninterface CalendarViewState {\n /** `null` until the user picks one: the settings' default view applies. */\n view: CalendarViewKind | null\n /** YYYY-MM-DD anchor; `null` = today. */\n date: string | null\n pendingEvent: PendingCalendarEvent | null\n pendingComposer: CalendarComposerPrefill | null\n setPendingComposer: (prefill: CalendarComposerPrefill | null) => void\n setView: (view: CalendarViewKind) => void\n setDate: (date: string | null) => void\n setPendingEvent: (pending: PendingCalendarEvent | null) => void\n}\n\nexport const useCalendarViewStore = create<CalendarViewState>()(\n persist(\n (set) => ({\n view: null,\n date: null,\n pendingEvent: null,\n pendingComposer: null,\n setPendingComposer: (pendingComposer) => set({ pendingComposer }),\n setView: (view) => set({ view }),\n setDate: (date) => set({ date }),\n setPendingEvent: (pendingEvent) => set({ pendingEvent }),\n }),\n {\n name: 'arbi-calendar-view',\n storage: createJSONStorage(() => localStorage),\n partialize: (s) => ({ view: s.view }),\n }\n )\n)\n\nconst EVT_RE = /^evt-[A-Za-z0-9]{8}$/\n\n/** Ask the calendar to open on an event (ignored unless it is an `evt-` id). */\nexport function requestCalendarEvent(event: PendingCalendarEvent): void {\n if (EVT_RE.test(event.id)) useCalendarViewStore.getState().setPendingEvent(event)\n}\n\n/** Ask the calendar to open the event editor prefilled. */\nexport function requestCalendarComposer(prefill: CalendarComposerPrefill): void {\n useCalendarViewStore.getState().setPendingComposer(prefill)\n}\n","/**\n * Promise-based prompt dialogs — the blocks replacement for `window.confirm` / `window.alert`.\n * Each call mounts its own short-lived React root, so it works from any event handler with no\n * dialog host in the tree. Hosts reach these through `useBlocksEnvironment().confirm` / `.choose`\n * (the defaults), which lets an app swap in its own dialogs without touching callers.\n *\n * For a confirmation with a loading state, render the declarative {@link ConfirmDialog} instead.\n */\nimport { useState, type ReactElement } from 'react'\nimport { AlertCircle, Info } from 'lucide-react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ModalScaffold } from '../settings/ModalScaffold'\n\ntype ChoiceVariant = 'default' | 'destructive' | 'outline'\n\nexport interface PromptChoice<T extends string> {\n label: string\n value: T\n variant?: ChoiceVariant\n}\n\n/** A dialog offering arbitrary choices (e.g. Overwrite / Skip / Cancel). */\nexport interface ChoiceRequest<T extends string> {\n message: string\n title?: string\n choices: PromptChoice<T>[]\n icon?: 'alert' | 'info'\n /** Dialog test id; each button is `${testId}-${value}-button`. Default `choice-modal`. */\n testId?: string\n}\n\n/**\n * `confirm` — Cancel / Confirm (destructive); `yesno` — No / Yes; `alert` — a single OK\n * (resolves true once acknowledged).\n */\nexport type ConfirmKind = 'confirm' | 'yesno' | 'alert'\n\nexport interface ConfirmRequest {\n message: string\n /** Default: \"Alert\" for `alert`, else \"Confirm\". */\n title?: string\n kind?: ConfirmKind\n}\n\n/** Close animation length before the root is unmounted. */\nconst UNMOUNT_DELAY_MS = 300\n\nfunction PromptDialog<T extends string>({\n request,\n onSettle,\n}: {\n request: ChoiceRequest<T>\n onSettle: (value: T | null) => void\n}): ReactElement {\n const [open, setOpen] = useState(true)\n const { message, title = 'Confirm', choices, icon = 'alert', testId = 'choice-modal' } = request\n const settle = (value: T | null) => {\n setOpen(false)\n onSettle(value)\n }\n return (\n <ModalScaffold\n open={open}\n onOpenChange={(next) => {\n if (!next) settle(null)\n }}\n title={title}\n icon={\n icon === 'info' ? (\n <Info className=\"h-5 w-5 text-blue-text\" aria-hidden=\"true\" />\n ) : (\n <AlertCircle className=\"h-5 w-5\" aria-hidden=\"true\" />\n )\n }\n description={<span className=\"whitespace-pre-line\">{message}</span>}\n showDescription\n testId={testId}\n >\n <ModalScaffold.Footer>\n {choices.map((choice) => (\n <Button\n key={choice.value}\n variant={choice.variant ?? 'default'}\n onClick={() => settle(choice.value)}\n data-testid={`${testId}-${choice.value.toLowerCase()}-button`}\n >\n {choice.label}\n </Button>\n ))}\n </ModalScaffold.Footer>\n </ModalScaffold>\n )\n}\n\n/** Show a choice dialog; resolves with the chosen `value`, or `null` when dismissed. */\nexport function choiceDialog<T extends string>(request: ChoiceRequest<T>): Promise<T | null> {\n if (typeof document === 'undefined') return Promise.resolve(null)\n return new Promise((resolve) => {\n const container = document.createElement('div')\n document.body.appendChild(container)\n let settled = false\n void import('react-dom/client').then(({ createRoot }) => {\n const root = createRoot(container)\n const onSettle = (value: T | null) => {\n if (settled) return\n settled = true\n resolve(value)\n setTimeout(() => {\n root.unmount()\n container.remove()\n }, UNMOUNT_DELAY_MS)\n }\n root.render(<PromptDialog request={request} onSettle={onSettle} />)\n })\n })\n}\n\nconst CONFIRM_CHOICES: Record<\n ConfirmKind,\n PromptChoice<'confirm' | 'cancel' | 'yes' | 'no' | 'ok'>[]\n> = {\n confirm: [\n { label: 'Cancel', value: 'cancel', variant: 'outline' },\n { label: 'Confirm', value: 'confirm', variant: 'destructive' },\n ],\n yesno: [\n { label: 'No', value: 'no', variant: 'outline' },\n { label: 'Yes', value: 'yes' },\n ],\n alert: [{ label: 'OK', value: 'ok' }],\n}\n\nconst CONFIRM_TEST_ID: Record<ConfirmKind, string> = {\n confirm: 'confirmation-modal',\n yesno: 'yes-no-modal',\n alert: 'alert-modal',\n}\n\n/** Show a confirmation; resolves true on Confirm / Yes / OK, false on cancel or dismissal. */\nexport async function confirmDialog(request: ConfirmRequest): Promise<boolean> {\n const kind = request.kind ?? 'confirm'\n const choice = await choiceDialog({\n message: request.message,\n title: request.title ?? (kind === 'alert' ? 'Alert' : 'Confirm'),\n choices: CONFIRM_CHOICES[kind],\n icon: kind === 'alert' ? 'info' : 'alert',\n testId: CONFIRM_TEST_ID[kind],\n })\n return choice === 'confirm' || choice === 'yes' || choice === 'ok'\n}\n","/**\n * The settings section asked for last, so `openSettings(section)` opens that section in every host.\n *\n * `BlocksEnvironment.openSettings` records the section here before the host shows its settings\n * (a panel, a route); a `ConnectedSettingsPage` without its own `section` prop opens at it and\n * follows every later request, even one for the section asked for before. A host that keeps the\n * open section itself (`section` + `onSectionChange`) routes `openSettings` to its own state.\n */\nimport { useSyncExternalStore } from 'react'\n\nexport interface SettingsSectionRequest {\n section: string\n /** Increases with every request, so asking again for the same section is a new request. */\n seq: number\n}\n\nlet request: SettingsSectionRequest | undefined\nconst listeners = new Set<() => void>()\n\n/** Ask for a settings section; no section asks for none (the page stays where it is). */\nexport function requestSettingsSection(section?: string): void {\n if (!section) return\n request = { section, seq: (request?.seq ?? 0) + 1 }\n listeners.forEach((listener) => listener())\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\nconst snapshot = () => request\n\n/** The last settings-section request (`undefined` until there is one). */\nexport function useRequestedSettingsSection(): SettingsSectionRequest | undefined {\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n","import type { ReactNode } from 'react'\nimport {\n notify as notifyStore,\n useHostConfigRecord,\n type NotifyOptions,\n type NotifyVariant,\n} from '@arbidocs/react/shell'\nimport type { BlockLinkComponent } from '../components/blockLink'\nimport { requestCalendarEvent, type PendingCalendarEvent } from '../connection/calendar/store'\nimport { choiceDialog, confirmDialog, type ChoiceRequest, type ConfirmRequest } from './dialogs'\nimport { conversationStartRequest, mailDraftRequest } from './requests'\nimport { requestSettingsSection } from './settings-section'\n\n/** What blocks need from the host's runtime configuration (the app's `config.json`). */\nexport interface BlocksRuntimeConfig {\n /** Origin of the ARBI API; `''` means the page's own origin. */\n apiBaseUrl: string\n /** The deployment's domain, e.g. `www.arbidocs.com` (deep links, key derivation, labels). */\n deploymentDomain: string\n}\n\nexport interface OpenDocumentOptions {\n /** 1-based page to scroll to. */\n page?: number\n /** Passage (chunk) to highlight. */\n passageId?: string\n /**\n * The workspace the document is in, when it is not the open one (a document an agent wrote in\n * its own workspace): the host opens that workspace first.\n */\n workspaceId?: string\n /** An earlier version (1-based); none: the current one. */\n version?: number\n /** The viewer tab to show: `pdf` is where a signature request is reviewed and signed. */\n tab?: 'pdf'\n}\n\nexport interface OpenWordEditorOptions {\n /** The comment to show (a mention in it, a reply to it). */\n commentId?: string\n /** The workspace the document is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenConversationOptions {\n /** The message to scroll to. */\n messageId?: string\n /** The open document stays on screen beside the thread (a thread about it). */\n keepDocumentOpen?: boolean\n /** The workspace the thread is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenNewConversationOptions {\n /** Its first message, sent once the new conversation is ready (an ask bar, \"Ask about this\"). */\n prompt?: string\n /** The open document stays on screen beside it (a chat started from it). */\n keepDocumentOpen?: boolean\n}\n\nexport interface OpenWorkflowOptions {\n /** The workflow's editor (default) or its runs. */\n view?: 'builder' | 'runs'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n /** The folder to show (`inbox`, `sent`, `trash`, `outbox`…). Default: the host's own. */\n folder?: string\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** Parts of the product a host can turn off (a setting, a plan): a kit offers them only when on. */\nexport type BlocksFeature = 'workflows'\n\n/** Where files are added from: this device, links, or an email account. */\nexport type UploadSource = 'computer' | 'internet' | 'email'\n\n/** What `openShare` shares by email. */\nexport interface ShareRequest {\n resourceType: 'document' | 'conversation'\n resourceExtId: string\n workspaceExtId: string\n resourceName?: string\n /** Whether it is private to its owner now: the dialog offers to share it with the workspace. */\n isPrivate: boolean\n}\n\n/** What `openFiles` shows: some files selected, and the list narrowed. */\nexport interface OpenFilesOptions {\n /** Files to select. */\n select?: string[]\n /** Quick filters by key (a label id, `folder:<path>`, `folder:none`): show or hide those files. */\n filters?: Record<string, 'include' | 'exclude'>\n}\n\n/**\n * Something a kit links to (the target of an `open…` intent), for `hrefFor`. `workspaceId` is the\n * workspace it is in, when the kit knows it.\n */\nexport type LinkTarget =\n | { kind: 'document'; documentId: string; workspaceId?: string | null }\n | {\n kind: 'conversation'\n conversationId: string\n workspaceId?: string | null\n messageId?: string\n }\n | { kind: 'workspace'; workspaceId: string }\n /** A project; none: the projects list. */\n | { kind: 'project'; projectId?: string }\n /** A workflow (its editor); none: the workflows list. */\n | { kind: 'workflow'; workflowId?: string; workspaceId?: string | null }\n /** The mailbox, on an email draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The user's settings, at a section when given. */\n | { kind: 'settings'; section?: string }\n /** The calendar, on an event when given. */\n | { kind: 'calendar'; eventId?: string }\n\n/**\n * The only way blocks reach the host app's environment: the host configuration's `environment`\n * (`<ArbiHost config={{ environment: { navigate, notify, … } }}>`). Blocks never import a router, a\n * toast library or an app store; the host gives what it has, and every field has a safe default so\n * a block renders correctly with no host at all. A nested host overrides only the fields it gives\n * and inherits the rest.\n */\nexport interface BlocksEnvironment {\n /** Router-aware link (keeps navigation in-SPA). Default: a plain `<a href>`. */\n linkComponent?: BlockLinkComponent\n /** Imperative navigation for buttons and keyboard shortcuts. Default: `window.location.assign`. */\n navigate: (href: string) => void\n /** Surface a transient message (and record it in the notification centre). Default: the shared\n * `@arbidocs/react` notify store, rendered by its `<Toaster/>`. */\n notify: (message: ReactNode, kind?: NotifyVariant, options?: NotifyOptions) => void\n /** Ask the user to confirm. Default: the blocks prompt dialog. */\n confirm: (request: ConfirmRequest) => Promise<boolean>\n /** Ask the user to pick one of several choices; `null` when dismissed. Default: the blocks\n * prompt dialog. */\n choose: <T extends string>(request: ChoiceRequest<T>) => Promise<T | null>\n /** Deployment configuration. Default: same-origin API on the page's own host. */\n runtimeConfig: BlocksRuntimeConfig\n /**\n * The address of a target in the host's router, for a real link (open in a new tab, middle-click,\n * copy link) beside the matching `open…` intent: a kit never builds an app path itself, so its\n * links and its navigation agree on every site. `undefined`: no link (the row still opens on a\n * click). Default: none. ARBI-style paths (`/wrk-…/doc-…`): `deepLinkHref`.\n */\n hrefFor: (target: LinkTarget) => string | undefined\n /** Open a document (optionally at a page / passage) wherever the host shows documents.\n * Default: no-op. */\n openDocument: (documentId: string, options?: OpenDocumentOptions) => void\n /**\n * Open a Word document (`opensInWord`) in the host's Word editor, optionally on a comment.\n * Default: `openDocument` (a host whose viewer edits Word documents in place needs no other).\n */\n openWordEditor: (documentId: string, options?: OpenWordEditorOptions) => void\n /** Open a conversation thread, optionally scrolled to a message. Default: no-op. */\n openConversation: (conversationId: string, options?: OpenConversationOptions) => void\n /**\n * Show a new, empty conversation, unbound to any document. With a `prompt` it is sent as the\n * first message once the conversation is ready (recorded for the chat that shows it:\n * `ConnectedConversation`, `ChatPage`). Without one a launch composes into the session's draft\n * after this. Default: no-op.\n */\n openNewConversation: (options?: OpenNewConversationOptions) => void\n /**\n * Open the user's settings, optionally at a section (a `ConnectedSettingsPage` section id).\n * The section is always recorded for `ConnectedSettingsPage` first (`requestSettingsSection`);\n * the host's handler then shows its settings. Default: only that record.\n */\n openSettings: (section?: string) => void\n /** Open a project; no id: the projects list. Default: no-op. */\n openProject: (projectId?: string) => void\n /**\n * Show the calendar page (`ConnectedCalendar`), optionally on an event (recorded for the\n * calendar first: `requestCalendarEvent`). Default: only that record.\n */\n openCalendar: (options?: OpenCalendarOptions) => void\n /**\n * Show the mailbox (`ConnectedMailbox`), optionally on an email draft (recorded for the mailbox\n * first). Absent: the host has no mail, and a kit offers no way to open it.\n */\n openMail?: (options?: OpenMailOptions) => void\n /** Show the host's calls page (call history, scheduled calls). Absent: not offered. */\n openCalls?: () => void\n /** Show the host's notification centre (`ConnectedNotificationCenter`). Absent: not offered. */\n openNotifications?: () => void\n /**\n * Open a workflow in the host's Workflows page (its editor, or its runs); no id: the list.\n * Offered only while the `workflows` feature is on (`useOpenWorkflow`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * A React hook: whether a part of the product is on for this user (a setting, a plan). Kits\n * offer what is off nowhere. Default: everything is on.\n */\n useFeature: (feature: BlocksFeature) => boolean\n /** Show the open workspace's files, optionally with some selected and the list narrowed. Default: no-op. */\n openFiles: (options?: OpenFilesOptions) => void\n /**\n * Add files the host's way (its upload dialog), optionally with some already picked, or from one\n * source. Absent: a kit that adds files uploads them itself.\n */\n openUpload?: (files?: File[], options?: { source?: UploadSource }) => void\n /** Open the host's skills browser, optionally at one skill. Absent: not offered. */\n openSkillsBrowser?: (skillSlug?: string) => void\n /** Share a document or a thread by email (the host's share dialog). Absent: not offered. */\n openShare?: (request: ShareRequest) => void\n /**\n * Show a workspace (its own page). Under `defaultHost`'s sign-in layer the kits select it first\n * (`useConnectedWorkspace().openWorkspace`); a host that keeps its own session switches to it\n * here. `name` is for the host's messages. Default: no-op.\n */\n openWorkspace: (workspaceId: string, options?: { name?: string }) => void\n}\n\nconst noop = () => {}\n\nconst defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\n runtimeConfig: {\n apiBaseUrl: '',\n deploymentDomain: typeof window !== 'undefined' ? window.location.host : '',\n },\n hrefFor: () => undefined,\n openDocument: noop,\n openWordEditor: noop,\n openConversation: noop,\n openNewConversation: noop,\n openSettings: requestSettingsSection,\n openProject: noop,\n openCalendar: (options) => {\n if (options?.event) requestCalendarEvent(options.event)\n },\n useFeature: () => true,\n openFiles: noop,\n openWorkspace: noop,\n}\n\nconst resolved = new WeakMap<object, BlocksEnvironment>()\nconst complete = new WeakSet<BlocksEnvironment>()\n// The intents below that record what they open on: a resolved environment passed on again (a\n// nested host's, `createBlocksEnvironment`'s) records once, not twice.\nconst recording = new WeakSet<object>()\n\nfunction records<F extends object>(intent: F): F {\n recording.add(intent)\n return intent\n}\n\nfunction recordingIntent<F extends object>(\n host: F | undefined,\n wrap: (host: F) => F\n): F | undefined {\n if (!host) return undefined\n return recording.has(host) ? host : records(wrap(host))\n}\n\nfunction resolve(environment: Partial<BlocksEnvironment>): BlocksEnvironment {\n const { openDocument } = environment\n const value: BlocksEnvironment = {\n ...defaultEnvironment,\n openWordEditor: openDocument\n ? (documentId, options) => openDocument(documentId, { workspaceId: options?.workspaceId })\n : noop,\n ...environment,\n // What an intent opens on is recorded for the surface before the host shows it.\n openSettings:\n recordingIntent(environment.openSettings, (openSettings) => (section) => {\n requestSettingsSection(section)\n openSettings(section)\n }) ?? defaultEnvironment.openSettings,\n openCalendar:\n recordingIntent(environment.openCalendar, (openCalendar) => (options) => {\n defaultEnvironment.openCalendar(options)\n openCalendar(options)\n }) ?? defaultEnvironment.openCalendar,\n openMail: recordingIntent(environment.openMail, (openMail) => (options) => {\n if (options?.draftId) mailDraftRequest.request(options.draftId)\n openMail(options)\n }),\n openNewConversation:\n recordingIntent(environment.openNewConversation, (openNewConversation) => (options) => {\n openNewConversation(options)\n // After the host's reset of the new conversation, which clears its draft.\n const prompt = options?.prompt?.trim()\n if (prompt) conversationStartRequest.request(prompt)\n }) ?? noop,\n }\n complete.add(value)\n return value\n}\n\n/**\n * The environment with every field filled in (the defaults where `environment` gives none), and\n * every intent recording what it opens on. A host calls it for code outside React (a store action,\n * a notification handler); passing the result as the host configuration's `environment` uses it\n * as is.\n */\nexport function createBlocksEnvironment(\n environment: Partial<BlocksEnvironment>\n): BlocksEnvironment {\n if (complete.has(environment as BlocksEnvironment)) return environment as BlocksEnvironment\n let value = resolved.get(environment)\n if (!value) resolved.set(environment, (value = resolve(environment)))\n return value\n}\n\n/** The host's environment, every field filled in (the defaults where the host gives none). */\nexport function useBlocksEnvironment(): BlocksEnvironment {\n const environment = useHostConfigRecord().environment as Partial<BlocksEnvironment> | undefined\n return environment ? createBlocksEnvironment(environment) : defaultEnvironment\n}\n\n/**\n * How to open a workflow in the host's Workflows page, or `undefined` while there is none (the\n * host has no `openWorkflow`, or the `workflows` feature is off).\n */\nexport function useOpenWorkflow(): BlocksEnvironment['openWorkflow'] {\n const { openWorkflow, useFeature } = useBlocksEnvironment()\n const enabled = useFeature('workflows')\n return enabled ? openWorkflow : undefined\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkX56B2VGH_cjs = require('./chunk-X56B2VGH.cjs');
4
+ var chunkBZF6E46W_cjs = require('./chunk-BZF6E46W.cjs');
5
5
  var react = require('react');
6
6
  var lucideReact = require('lucide-react');
7
7
  var ui = require('@arbidocs/react/ui');
@@ -83,7 +83,7 @@ function CopyLinkButton({
83
83
  labels,
84
84
  testId
85
85
  }) {
86
- const { notify } = chunkX56B2VGH_cjs.useBlocksEnvironment();
86
+ const { notify } = chunkBZF6E46W_cjs.useBlocksEnvironment();
87
87
  const [copied, setCopied] = react.useState(false);
88
88
  const timer = react.useRef(null);
89
89
  react.useEffect(
@@ -254,7 +254,7 @@ var DEFAULT_QUIET_MARK_LABELS = {
254
254
  bookmarkMenu: "Bookmark actions"
255
255
  };
256
256
  function useCopyText(labels) {
257
- const { notify } = chunkX56B2VGH_cjs.useBlocksEnvironment();
257
+ const { notify } = chunkBZF6E46W_cjs.useBlocksEnvironment();
258
258
  const done = labels?.linkCopied ?? DEFAULT_QUIET_MARK_LABELS.linkCopied;
259
259
  const failed = labels?.copyFailed ?? DEFAULT_QUIET_MARK_LABELS.copyFailed;
260
260
  return react.useCallback(
@@ -411,5 +411,5 @@ exports.PassageMark = PassageMark;
411
411
  exports.PassagePill = PassagePill;
412
412
  exports.QuietLink = QuietLink;
413
413
  exports.useCopyText = useCopyText;
414
- //# sourceMappingURL=chunk-WGXUAHKD.cjs.map
415
- //# sourceMappingURL=chunk-WGXUAHKD.cjs.map
414
+ //# sourceMappingURL=chunk-6WX7ZMKL.cjs.map
415
+ //# sourceMappingURL=chunk-6WX7ZMKL.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/citations/PassagePill.tsx","../src/citations/QuietMarks.tsx"],"names":["jsxs","Fragment","jsx","cn","Tooltip","TooltipTrigger","TooltipContent","useBlocksEnvironment","useState","useRef","useEffect","Check","Copy","useCallback","MarkMenu"],"mappings":";;;;;;;;AA4BO,IAAM,2BAAA,GAAiD;AAAA,EAC5D,QAAA,EAAU,mBAAA;AAAA,EACV,MAAA,EAAQ,qBAAA;AAAA,EACR,UAAA,EAAY,iCAAA;AAAA,EACZ,WAAA,EAAa,cAAA;AAAA,EACb,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,SAAA;AAAA,EACT,QAAA,EAAU,UAAA;AAAA,EACV,gBAAA,EAAkB;AACpB;AAkCA,IAAM,eAAA,GAAkB,GAAA;AAGxB,SAAS,eAAA,CACP,aAAA,EACA,CAAA,EACA,IAAA,EACA,OAAA,EACQ;AACR,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,IAAA,CAAK,IAAA,KAAS,MAAA,GAAY,CAAA,EAAG,IAAA,CAAK,OAAA,GAAU,CAAA,CAAE,KAAA,GAAQ,CAAA,CAAE,IAAI,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAA,CAAA,GAAK,IAAA;AAAA,IAC9E,OAAA,CAAQ,IAAA,KAAS,MAAA,GACb,CAAA,EAAG,OAAA,CAAQ,OAAA,GAAU,CAAA,CAAE,QAAA,GAAW,CAAA,CAAE,OAAO,CAAA,CAAA,EAAI,OAAA,CAAQ,IAAI,CAAA,C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A;AACF,CAAA,EAAmB;AACjB,EAAA,uBACED,cAAAA;AAAA,IAACY,WAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA;AAAA,MACA,SAAA;AAAA,MACA,MAAA;AAAA,MACA,YAAA,EAAY,IAAA;AAAA,MACZ,gBAAA,EAAe,OAAA;AAAA,MACf,SAAA,EAAWX,KAAAA;AAAA,QACT,iKAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA,MAAA,CAAO,MAAM,CAAA,EAAG,CAAC,EAAE,GAAA,CAAI,CAAC,CAAA,EAAG,CAAA,qBAC1BD,cAAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UAEC,aAAA,EAAY,MAAA;AAAA,UACZ,SAAA,EAAU,wBAAA;AAAA,UACV,KAAA,EAAO,EAAE,eAAA,EAAiB,CAAA;AAAE,SAAA;AAAA,QAHvB;AAAA,OAKR;AAAA;AAAA,GACH;AAEJ;AAkBO,SAAS,QAAA,CAAS;AAAA,EACvB,KAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA,GAAY,cAAA;AAAA,EACZ,QAAQ,EAAC;AAAA,EACT,SAAA;AAAA,EACA;AACF,CAAA,EAAkB;AAChB,EAAA,uBACEA,cAAAA;AAAA,IAACY,WAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA,EACE,wBAAQZ,cAAAA,CAAC,UAAK,SAAA,EAAU,qCAAA,EAAuC,iBAAM,CAAA,GAAU,MAAA;AAAA,MAEjF,SAAA;AAAA,MACA,MAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,gBAAA,EAAe,MAAA;AAAA,MACf,SAAA,EAAWC,KAAAA;AAAA,QACT,4OAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-WGXUAHKD.cjs","sourcesContent":["import {\n useEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { Check, Copy } from 'lucide-react'\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/** Every fixed string of the passage pill. */\nexport interface PassagePillLabels {\n copyLink: string\n /** Announced and notified after the link was copied. */\n copied: string\n /** Notified when the clipboard refused the write. */\n copyFailed: string\n viewPassage: string\n page: string\n pages: string\n passage: string\n passages: string\n /** Visible abbreviation of \"page\" in the pill (\"p.3\"). */\n pageAbbreviation: string\n}\n\nexport const DEFAULT_PASSAGE_PILL_LABELS: PassagePillLabels = {\n copyLink: 'Copy passage link',\n copied: 'Passage link copied',\n copyFailed: 'Could not copy the passage link',\n viewPassage: 'View passage',\n page: 'Page',\n pages: 'Pages',\n passage: 'Passage',\n passages: 'Passages',\n pageAbbreviation: 'p.',\n}\n\n/** Overridable `data-testid`s of the pill (defaults keep the app's existing ids). */\nexport interface PassagePillTestIds {\n root: string\n copy: string\n}\n\nexport interface PassagePillProps {\n /** Glyph of the cited document (host-supplied: file-type icon). */\n icon: ReactNode\n documentTitle: string\n /** `pill`: title + page; `icon`: glyph only; `compact`: page/passage ref + copy link. */\n variant?: 'icon' | 'pill' | 'compact'\n pageNumber?: number\n passageIndex?: number\n /** End of a contiguous passage run: the label collapses to \"4–9\" instead of a pill each. */\n passageIndexEnd?: number\n /** End page of a range: \"p.3–5(4–9)\". */\n pageNumberEnd?: number\n /** Makes the element a link. */\n href?: string\n /** Makes the element a button (ignored for the element role when `href` is set). */\n onClick?: (e: MouseEvent) => void\n showTooltip?: boolean\n labelMaxWidth?: string\n size?: 'sm' | 'base'\n className?: string\n labels?: Partial<PassagePillLabels>\n testIds?: Partial<PassagePillTestIds>\n /** Root test id (default `passage-entity`); the copy button gets `<id>-copy`. */\n testId?: string\n}\n\nconst COPIED_RESET_MS = 2000\n\n/** Plain-language name of a passage reference: \"Title, Page 3, Passage 4\". */\nfunction describePassage(\n documentTitle: string,\n l: PassagePillLabels,\n page: { text?: string; isRange: boolean },\n passage: { text?: string; isRange: boolean }\n): string {\n return [\n documentTitle,\n page.text !== undefined ? `${page.isRange ? l.pages : l.page} ${page.text}` : null,\n passage.text !== undefined\n ? `${passage.isRange ? l.passages : l.passage} ${passage.text}`\n : null,\n ]\n .filter(Boolean)\n .join(', ')\n}\n\ninterface PillSurfaceProps {\n href?: string\n onClick?: (e: MouseEvent) => void\n className: string\n testId: string\n /** What assistive tech reads; the visible content is hidden from it. */\n accessibleName: string\n children: ReactNode\n tooltip?: ReactNode\n tooltipSide?: 'top' | 'bottom'\n}\n\n/**\n * The ONE interactive element of a pill: a link, a button or (when there is no action) plain text.\n * Never nests another interactive element, so it is valid inside any host container.\n */\nfunction PillSurface({\n href,\n onClick,\n className,\n testId,\n accessibleName,\n children,\n tooltip,\n tooltipSide = 'bottom',\n}: PillSurfaceProps) {\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"inline-flex min-w-0 items-center gap-1\">\n {children}\n </span>\n <span className=\"sr-only\">{accessibleName}</span>\n </>\n )\n const interactive = cn(\n 'relative cursor-pointer hover:bg-muted/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n \"pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\n )\n\n let surface: ReactNode\n if (href) {\n surface = (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </a>\n )\n } else if (onClick) {\n surface = (\n <button\n type=\"button\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </button>\n )\n } else {\n surface = (\n <span className={className} data-testid={testId}>\n {content}\n </span>\n )\n }\n\n if (!tooltip) return surface\n return (\n <Tooltip>\n <TooltipTrigger asChild>{surface as ReactElement}</TooltipTrigger>\n <TooltipContent side={tooltipSide}>{tooltip}</TooltipContent>\n </Tooltip>\n )\n}\n\nfunction CopyLinkButton({\n href,\n labels,\n testId,\n}: {\n href: string\n labels: PassagePillLabels\n testId: string\n}) {\n const { notify } = useBlocksEnvironment()\n const [copied, setCopied] = useState(false)\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current)\n },\n []\n )\n\n const handleCopy = async (e: MouseEvent) => {\n e.stopPropagation()\n try {\n await navigator.clipboard.writeText(href)\n } catch {\n // Say so instead of pretending: the host's notify surfaces the failure.\n notify(labels.copyFailed, 'error')\n return\n }\n setCopied(true)\n notify(labels.copied, 'success')\n if (timer.current) clearTimeout(timer.current)\n timer.current = setTimeout(() => setCopied(false), COPIED_RESET_MS)\n }\n\n return (\n <>\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"relative inline-flex items-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-fine:min-h-6 pointer-fine:min-w-6 pointer-fine:justify-center pointer-coarse:min-h-11 pointer-coarse:min-w-11 pointer-coarse:justify-center\"\n title={labels.copyLink}\n aria-label={labels.copyLink}\n data-testid={testId}\n >\n {copied ? (\n <Check className=\"size-3\" aria-hidden=\"true\" />\n ) : (\n <Copy className=\"size-3\" aria-hidden=\"true\" />\n )}\n </button>\n <span role=\"status\" className=\"sr-only\">\n {copied ? labels.copied : ''}\n </span>\n </>\n )\n}\n\n/** A citation to a passage of a document, as a pill, a bare icon or a compact page reference. */\nexport function PassagePill({\n icon,\n documentTitle,\n variant = 'pill',\n pageNumber,\n passageIndex,\n passageIndexEnd,\n pageNumberEnd,\n href,\n className,\n onClick,\n showTooltip = true,\n labelMaxWidth,\n size = 'sm',\n labels,\n testIds,\n testId = 'passage-entity',\n}: PassagePillProps) {\n const l = { ...DEFAULT_PASSAGE_PILL_LABELS, ...labels }\n const ids: PassagePillTestIds = {\n root: testIds?.root ?? testId,\n copy: testIds?.copy ?? `${testIds?.root ?? testId}-copy`,\n }\n // Ranges collapse to \"4–9\"; a range of one renders as a plain \"4\".\n const isPassageRange = passageIndexEnd !== undefined && passageIndexEnd > (passageIndex ?? 0)\n const isPageRange = pageNumberEnd !== undefined && pageNumberEnd > (pageNumber ?? 0)\n const passageText = isPassageRange ? `${passageIndex}–${passageIndexEnd}` : `${passageIndex}`\n const pageText = isPageRange ? `${pageNumber}–${pageNumberEnd}` : `${pageNumber}`\n const accessibleName = describePassage(\n documentTitle,\n l,\n { text: pageNumber !== undefined ? pageText : undefined, isRange: isPageRange },\n { text: passageIndex !== undefined ? passageText : undefined, isRange: isPassageRange }\n )\n const hasAction = Boolean(href || onClick)\n\n if (variant === 'icon') {\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn('inline-flex items-center rounded-sm', className)}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={\n showTooltip ? (\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium\">{documentTitle}</span>\n {(pageNumber !== undefined || passageIndex !== undefined) && (\n <span className=\"text-xs text-muted-foreground\">\n {pageNumber !== undefined && `${isPageRange ? l.pages : l.page} ${pageText}`}\n {pageNumber !== undefined && passageIndex !== undefined && ', '}\n {passageIndex !== undefined &&\n `${isPassageRange ? l.passages : l.passage} ${passageText}`}\n </span>\n )}\n </div>\n ) : undefined\n }\n >\n {icon}\n </PillSurface>\n )\n }\n\n if (variant === 'compact') {\n const label =\n [\n pageNumber !== undefined ? `${l.pageAbbreviation}${pageText}` : null,\n passageIndex !== undefined ? `(${passageText})` : null,\n ]\n .filter(Boolean)\n .join('') || '—'\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-md border border-transparent bg-muted px-1 text-sm font-medium',\n className\n )}\n >\n <PillSurface\n href={href}\n onClick={onClick}\n className=\"inline-flex items-center gap-1 rounded-sm\"\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip ? documentTitle : undefined}\n >\n {icon}\n <span className=\"leading-tight\">{label}</span>\n </PillSurface>\n {href && <CopyLinkButton href={href} labels={l} testId={ids.copy} />}\n </span>\n )\n }\n\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn(\n 'group/pill inline-flex items-center rounded-md border border-border bg-muted transition-all',\n size === 'base' ? 'gap-1.5 px-1.5 py-0.5 text-base' : 'gap-1 px-1 text-sm',\n className\n )}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip && hasAction ? l.viewPassage : undefined}\n >\n {icon}\n <span\n className={cn(\n 'min-w-0 truncate font-medium leading-tight',\n labelMaxWidth ?? 'max-w-[320px]'\n )}\n >\n {documentTitle}\n </span>\n {pageNumber ? (\n <span className=\"flex-shrink-0 text-xs leading-none text-muted-foreground\">\n {l.pageAbbreviation}\n {pageText}\n </span>\n ) : null}\n </PillSurface>\n )\n}\n","import { useCallback, type ReactNode } from 'react'\nimport { MarkMenu, cn, type MarkMenuItem } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/**\n * Quiet inline marks: links, bookmarks, passage references, label and note marks.\n *\n * Each is typographically distinct TEXT (no pill, no button chrome, no icon in the flow) and owns\n * exactly one contextual menu through the shared `MarkMenu`. Domain-neutral: hosts supply the\n * handlers that make a row mean something.\n */\n\n/** Every fixed string of the quiet marks. */\nexport interface QuietMarkLabels {\n openLink: string\n copyLink: string\n linkCopied: string\n copyFailed: string\n jumpHere: string\n copyPlaceLink: string\n openDocument: string\n linkMenu: string\n bookmarkMenu: string\n}\n\nexport const DEFAULT_QUIET_MARK_LABELS: QuietMarkLabels = {\n openLink: 'Open link',\n copyLink: 'Copy link',\n linkCopied: 'Link copied',\n copyFailed: 'Could not copy',\n jumpHere: 'Jump to here',\n copyPlaceLink: 'Copy link to this place',\n openDocument: 'Open document',\n linkMenu: 'Link actions',\n bookmarkMenu: 'Bookmark actions',\n}\n\n/**\n * Copy text to the clipboard and say so (or say it failed) through the host's `notify`. Resolves\n * whether it was copied.\n */\nexport function useCopyText(labels?: Partial<Pick<QuietMarkLabels, 'linkCopied' | 'copyFailed'>>) {\n const { notify } = useBlocksEnvironment()\n const done = labels?.linkCopied ?? DEFAULT_QUIET_MARK_LABELS.linkCopied\n const failed = labels?.copyFailed ?? DEFAULT_QUIET_MARK_LABELS.copyFailed\n return useCallback(\n async (text: string, message?: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(text)\n notify(message ?? done, 'success')\n return true\n } catch {\n notify(failed, 'error')\n return false\n }\n },\n [notify, done, failed]\n )\n}\n\nexport type QuietLinkKind = 'external' | 'anchor' | 'document'\n\nexport interface QuietLinkProps {\n href?: string\n /** `external` (default) opens elsewhere, `anchor` jumps within the page, `document` is an in-app target. */\n kind?: QuietLinkKind\n /** The primary action. Defaults: external opens a new tab, anchor scrolls to the id. */\n onOpen?: () => void\n /** Absolute URL a copied anchor should carry; defaults to the current page plus the hash. */\n placeLink?: string\n labels?: Partial<QuietMarkLabels>\n className?: string\n testId?: string\n children: ReactNode\n}\n\nconst LINK_STYLE: Record<QuietLinkKind, string> = {\n external:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n document:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n // A bookmark is nearly invisible until hovered or focused.\n anchor:\n 'text-inherit underline decoration-dotted decoration-1 decoration-foreground/25 underline-offset-[3px] transition-colors hover:decoration-foreground/70 focus-visible:decoration-foreground/70',\n}\n\nfunction scrollToHash(href: string | undefined) {\n const id = href?.startsWith('#') ? decodeURIComponent(href.slice(1)) : ''\n document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' })\n}\n\n/** A hyperlink, bookmark or document link as quiet text with one menu (open / copy). */\nexport function QuietLink({\n href,\n kind = 'external',\n onOpen,\n placeLink,\n labels,\n className,\n testId,\n children,\n}: QuietLinkProps) {\n const l = { ...DEFAULT_QUIET_MARK_LABELS, ...labels }\n const copy = useCopyText(l)\n\n const open =\n onOpen ??\n (kind === 'anchor'\n ? () => scrollToHash(href)\n : () => {\n if (href) window.open(href, '_blank', 'noopener,noreferrer')\n })\n const copyTarget =\n kind === 'anchor'\n ? (placeLink ?? `${window.location.href.split('#')[0]}${href ?? ''}`)\n : (placeLink ?? href ?? '')\n\n const items: MarkMenuItem[] = [\n {\n id: 'open',\n label: kind === 'anchor' ? l.jumpHere : kind === 'document' ? l.openDocument : l.openLink,\n primary: true,\n onSelect: open,\n testId: 'mark-open',\n },\n {\n id: 'copy',\n label: kind === 'anchor' ? l.copyPlaceLink : l.copyLink,\n onSelect: () => void copy(copyTarget),\n testId: 'mark-copy',\n },\n ]\n\n return (\n <MarkMenu\n as=\"a\"\n href={href}\n items={items}\n menuLabel={kind === 'anchor' ? l.bookmarkMenu : l.linkMenu}\n preview={\n kind === 'external' && href ? (\n <span className=\"block break-all text-xs text-muted-foreground\">{href}</span>\n ) : undefined\n }\n className={cn(LINK_STYLE[kind], 'cursor-pointer', className)}\n testId={testId}\n data-mark-kind={kind}\n >\n {children}\n </MarkMenu>\n )\n}\n\nexport interface PassageMarkProps {\n /** The reference as plain text, e.g. \"¶4\" or \"¶4–9 · p.1\". */\n label: string\n menuLabel: string\n /** Menu rows: copy, link, label, open in navigator. */\n items: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/** A passage's reference as a faint text mark in the margin; its menu carries the passage actions. */\nexport function PassageMark({ label, menuLabel, items, className, testId }: PassageMarkProps) {\n return (\n <MarkMenu\n items={items}\n menuLabel={menuLabel}\n testId={testId}\n data-mark-kind=\"passage\"\n className={cn(\n 'touch-hit cursor-pointer select-none rounded-sm px-1 text-xs tabular-nums text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-2',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n\nexport interface LabelMarkProps {\n /** Colours of every label marking the passage. */\n colors: string[]\n menuLabel: string\n /** Names of the labels, shown in the menu. */\n preview?: ReactNode\n items: MarkMenuItem[]\n /** Accessible name of the stripes. */\n name: string\n className?: string\n testId?: string\n}\n\n/** The labels on a passage as thin margin stripes (not a chip); the menu shows / removes them. */\nexport function LabelMark({\n colors,\n menuLabel,\n preview,\n items,\n name,\n className,\n testId,\n}: LabelMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={preview}\n menuLabel={menuLabel}\n testId={testId}\n aria-label={name}\n data-mark-kind=\"label\"\n className={cn(\n 'flex cursor-pointer flex-col gap-1 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-1',\n className\n )}\n >\n {colors.slice(0, 4).map((c, i) => (\n <span\n key={i}\n aria-hidden=\"true\"\n className=\"h-2.5 w-1 rounded-full\"\n style={{ backgroundColor: c }}\n />\n ))}\n </MarkMenu>\n )\n}\n\nexport interface NoteMarkProps {\n /** Short label, e.g. the passage range this run covers (\"¶4–9\"). */\n label: string\n /** Full note text, shown as the menu preview so the mark is self-explaining. */\n title?: string\n menuLabel?: string\n /** Rows such as \"Show note\" and \"Edit\". With none, the menu is a read-only preview. */\n items?: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/**\n * Marks a passage as cited by a Note: small text with a soft yellow underline, drawn once on\n * each CONTIGUOUS run of cited passages (a run is one citation).\n */\nexport function NoteMark({\n label,\n title,\n menuLabel = 'Note actions',\n items = [],\n className,\n testId,\n}: NoteMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={\n title ? <span className=\"block text-xs text-muted-foreground\">{title}</span> : undefined\n }\n menuLabel={menuLabel}\n testId={testId}\n data-slot=\"note-mark\"\n data-mark-kind=\"note\"\n className={cn(\n 'cursor-default select-none rounded-sm px-1 text-xs font-medium tabular-nums text-foreground/80 underline decoration-yellow-400 decoration-2 underline-offset-[3px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/citations/PassagePill.tsx","../src/citations/QuietMarks.tsx"],"names":["jsxs","Fragment","jsx","cn","Tooltip","TooltipTrigger","TooltipContent","useBlocksEnvironment","useState","useRef","useEffect","Check","Copy","useCallback","MarkMenu"],"mappings":";;;;;;;;AA4BO,IAAM,2BAAA,GAAiD;AAAA,EAC5D,QAAA,EAAU,mBAAA;AAAA,EACV,MAAA,EAAQ,qBAAA;AAAA,EACR,UAAA,EAAY,iCAAA;AAAA,EACZ,WAAA,EAAa,cAAA;AAAA,EACb,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,SAAA;AAAA,EACT,QAAA,EAAU,UAAA;AAAA,EACV,gBAAA,EAAkB;AACpB;AAkCA,IAAM,eAAA,GAAkB,GAAA;AAGxB,SAAS,eAAA,CACP,aAAA,EACA,CAAA,EACA,IAAA,EACA,OAAA,EACQ;AACR,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,IAAA,CAAK,IAAA,KAAS,MAAA,GAAY,CAAA,EAAG,IAAA,CAAK,OAAA,GAAU,CAAA,CAAE,KAAA,GAAQ,CAAA,CAAE,IAAI,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAA,CAAA,GAAK,IAAA;AAAA,IAC9E,OAAA,CAAQ,IAAA,KAAS,MAAA,GACb,CAAA,EAAG,OAAA,CAAQ,OAAA,GAAU,CAAA,CAAE,QAAA,GAAW,CAAA,CAAE,OAAO,CAAA,CAAA,EAAI,OAAA,CAAQ,IAAI,CAAA,CAAA,GAC3D;AAAA,GACN,CACG,MAAA,CAAO,OAAO,CAAA,CACd,KAAK,IAAI,CAAA;AACd;AAkBA,SAAS,WAAA,CAAY;AAAA,EACnB,IAAA;AAAA,EACA,OAAA;AAAA,EACA,SAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAA;AAAA,EACA,QAAA;AAAA,EACA,OAAA;AAAA,EACA,WAAA,GAAc;AAChB,CAAA,EAAq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AAAA,OACF;AAAA,MAEC,QAAA,EAAA,MAAA,CAAO,MAAM,CAAA,EAAG,CAAC,EAAE,GAAA,CAAI,CAAC,CAAA,EAAG,CAAA,qBAC1BD,cAAAA;AAAA,QAAC,MAAA;AAAA,QAAA;AAAA,UAEC,aAAA,EAAY,MAAA;AAAA,UACZ,SAAA,EAAU,wBAAA;AAAA,UACV,KAAA,EAAO,EAAE,eAAA,EAAiB,CAAA;AAAE,SAAA;AAAA,QAHvB;AAAA,OAKR;AAAA;AAAA,GACH;AAEJ;AAkBO,SAAS,QAAA,CAAS;AAAA,EACvB,KAAA;AAAA,EACA,KAAA;AAAA,EACA,SAAA,GAAY,cAAA;AAAA,EACZ,QAAQ,EAAC;AAAA,EACT,SAAA;AAAA,EACA;AACF,CAAA,EAAkB;AAChB,EAAA,uBACEA,cAAAA;AAAA,IAACY,WAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA,EACE,wBAAQZ,cAAAA,CAAC,UAAK,SAAA,EAAU,qCAAA,EAAuC,iBAAM,CAAA,GAAU,MAAA;AAAA,MAEjF,SAAA;AAAA,MACA,MAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,gBAAA,EAAe,MAAA;AAAA,MACf,SAAA,EAAWC,KAAAA;AAAA,QACT,4OAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-6WX7ZMKL.cjs","sourcesContent":["import {\n useEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { Check, Copy } from 'lucide-react'\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/** Every fixed string of the passage pill. */\nexport interface PassagePillLabels {\n copyLink: string\n /** Announced and notified after the link was copied. */\n copied: string\n /** Notified when the clipboard refused the write. */\n copyFailed: string\n viewPassage: string\n page: string\n pages: string\n passage: string\n passages: string\n /** Visible abbreviation of \"page\" in the pill (\"p.3\"). */\n pageAbbreviation: string\n}\n\nexport const DEFAULT_PASSAGE_PILL_LABELS: PassagePillLabels = {\n copyLink: 'Copy passage link',\n copied: 'Passage link copied',\n copyFailed: 'Could not copy the passage link',\n viewPassage: 'View passage',\n page: 'Page',\n pages: 'Pages',\n passage: 'Passage',\n passages: 'Passages',\n pageAbbreviation: 'p.',\n}\n\n/** Overridable `data-testid`s of the pill (defaults keep the app's existing ids). */\nexport interface PassagePillTestIds {\n root: string\n copy: string\n}\n\nexport interface PassagePillProps {\n /** Glyph of the cited document (host-supplied: file-type icon). */\n icon: ReactNode\n documentTitle: string\n /** `pill`: title + page; `icon`: glyph only; `compact`: page/passage ref + copy link. */\n variant?: 'icon' | 'pill' | 'compact'\n pageNumber?: number\n passageIndex?: number\n /** End of a contiguous passage run: the label collapses to \"4–9\" instead of a pill each. */\n passageIndexEnd?: number\n /** End page of a range: \"p.3–5(4–9)\". */\n pageNumberEnd?: number\n /** Makes the element a link. */\n href?: string\n /** Makes the element a button (ignored for the element role when `href` is set). */\n onClick?: (e: MouseEvent) => void\n showTooltip?: boolean\n labelMaxWidth?: string\n size?: 'sm' | 'base'\n className?: string\n labels?: Partial<PassagePillLabels>\n testIds?: Partial<PassagePillTestIds>\n /** Root test id (default `passage-entity`); the copy button gets `<id>-copy`. */\n testId?: string\n}\n\nconst COPIED_RESET_MS = 2000\n\n/** Plain-language name of a passage reference: \"Title, Page 3, Passage 4\". */\nfunction describePassage(\n documentTitle: string,\n l: PassagePillLabels,\n page: { text?: string; isRange: boolean },\n passage: { text?: string; isRange: boolean }\n): string {\n return [\n documentTitle,\n page.text !== undefined ? `${page.isRange ? l.pages : l.page} ${page.text}` : null,\n passage.text !== undefined\n ? `${passage.isRange ? l.passages : l.passage} ${passage.text}`\n : null,\n ]\n .filter(Boolean)\n .join(', ')\n}\n\ninterface PillSurfaceProps {\n href?: string\n onClick?: (e: MouseEvent) => void\n className: string\n testId: string\n /** What assistive tech reads; the visible content is hidden from it. */\n accessibleName: string\n children: ReactNode\n tooltip?: ReactNode\n tooltipSide?: 'top' | 'bottom'\n}\n\n/**\n * The ONE interactive element of a pill: a link, a button or (when there is no action) plain text.\n * Never nests another interactive element, so it is valid inside any host container.\n */\nfunction PillSurface({\n href,\n onClick,\n className,\n testId,\n accessibleName,\n children,\n tooltip,\n tooltipSide = 'bottom',\n}: PillSurfaceProps) {\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"inline-flex min-w-0 items-center gap-1\">\n {children}\n </span>\n <span className=\"sr-only\">{accessibleName}</span>\n </>\n )\n const interactive = cn(\n 'relative cursor-pointer hover:bg-muted/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n \"pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\n )\n\n let surface: ReactNode\n if (href) {\n surface = (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </a>\n )\n } else if (onClick) {\n surface = (\n <button\n type=\"button\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </button>\n )\n } else {\n surface = (\n <span className={className} data-testid={testId}>\n {content}\n </span>\n )\n }\n\n if (!tooltip) return surface\n return (\n <Tooltip>\n <TooltipTrigger asChild>{surface as ReactElement}</TooltipTrigger>\n <TooltipContent side={tooltipSide}>{tooltip}</TooltipContent>\n </Tooltip>\n )\n}\n\nfunction CopyLinkButton({\n href,\n labels,\n testId,\n}: {\n href: string\n labels: PassagePillLabels\n testId: string\n}) {\n const { notify } = useBlocksEnvironment()\n const [copied, setCopied] = useState(false)\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current)\n },\n []\n )\n\n const handleCopy = async (e: MouseEvent) => {\n e.stopPropagation()\n try {\n await navigator.clipboard.writeText(href)\n } catch {\n // Say so instead of pretending: the host's notify surfaces the failure.\n notify(labels.copyFailed, 'error')\n return\n }\n setCopied(true)\n notify(labels.copied, 'success')\n if (timer.current) clearTimeout(timer.current)\n timer.current = setTimeout(() => setCopied(false), COPIED_RESET_MS)\n }\n\n return (\n <>\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"relative inline-flex items-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-fine:min-h-6 pointer-fine:min-w-6 pointer-fine:justify-center pointer-coarse:min-h-11 pointer-coarse:min-w-11 pointer-coarse:justify-center\"\n title={labels.copyLink}\n aria-label={labels.copyLink}\n data-testid={testId}\n >\n {copied ? (\n <Check className=\"size-3\" aria-hidden=\"true\" />\n ) : (\n <Copy className=\"size-3\" aria-hidden=\"true\" />\n )}\n </button>\n <span role=\"status\" className=\"sr-only\">\n {copied ? labels.copied : ''}\n </span>\n </>\n )\n}\n\n/** A citation to a passage of a document, as a pill, a bare icon or a compact page reference. */\nexport function PassagePill({\n icon,\n documentTitle,\n variant = 'pill',\n pageNumber,\n passageIndex,\n passageIndexEnd,\n pageNumberEnd,\n href,\n className,\n onClick,\n showTooltip = true,\n labelMaxWidth,\n size = 'sm',\n labels,\n testIds,\n testId = 'passage-entity',\n}: PassagePillProps) {\n const l = { ...DEFAULT_PASSAGE_PILL_LABELS, ...labels }\n const ids: PassagePillTestIds = {\n root: testIds?.root ?? testId,\n copy: testIds?.copy ?? `${testIds?.root ?? testId}-copy`,\n }\n // Ranges collapse to \"4–9\"; a range of one renders as a plain \"4\".\n const isPassageRange = passageIndexEnd !== undefined && passageIndexEnd > (passageIndex ?? 0)\n const isPageRange = pageNumberEnd !== undefined && pageNumberEnd > (pageNumber ?? 0)\n const passageText = isPassageRange ? `${passageIndex}–${passageIndexEnd}` : `${passageIndex}`\n const pageText = isPageRange ? `${pageNumber}–${pageNumberEnd}` : `${pageNumber}`\n const accessibleName = describePassage(\n documentTitle,\n l,\n { text: pageNumber !== undefined ? pageText : undefined, isRange: isPageRange },\n { text: passageIndex !== undefined ? passageText : undefined, isRange: isPassageRange }\n )\n const hasAction = Boolean(href || onClick)\n\n if (variant === 'icon') {\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn('inline-flex items-center rounded-sm', className)}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={\n showTooltip ? (\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium\">{documentTitle}</span>\n {(pageNumber !== undefined || passageIndex !== undefined) && (\n <span className=\"text-xs text-muted-foreground\">\n {pageNumber !== undefined && `${isPageRange ? l.pages : l.page} ${pageText}`}\n {pageNumber !== undefined && passageIndex !== undefined && ', '}\n {passageIndex !== undefined &&\n `${isPassageRange ? l.passages : l.passage} ${passageText}`}\n </span>\n )}\n </div>\n ) : undefined\n }\n >\n {icon}\n </PillSurface>\n )\n }\n\n if (variant === 'compact') {\n const label =\n [\n pageNumber !== undefined ? `${l.pageAbbreviation}${pageText}` : null,\n passageIndex !== undefined ? `(${passageText})` : null,\n ]\n .filter(Boolean)\n .join('') || '—'\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-md border border-transparent bg-muted px-1 text-sm font-medium',\n className\n )}\n >\n <PillSurface\n href={href}\n onClick={onClick}\n className=\"inline-flex items-center gap-1 rounded-sm\"\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip ? documentTitle : undefined}\n >\n {icon}\n <span className=\"leading-tight\">{label}</span>\n </PillSurface>\n {href && <CopyLinkButton href={href} labels={l} testId={ids.copy} />}\n </span>\n )\n }\n\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn(\n 'group/pill inline-flex items-center rounded-md border border-border bg-muted transition-all',\n size === 'base' ? 'gap-1.5 px-1.5 py-0.5 text-base' : 'gap-1 px-1 text-sm',\n className\n )}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip && hasAction ? l.viewPassage : undefined}\n >\n {icon}\n <span\n className={cn(\n 'min-w-0 truncate font-medium leading-tight',\n labelMaxWidth ?? 'max-w-[320px]'\n )}\n >\n {documentTitle}\n </span>\n {pageNumber ? (\n <span className=\"flex-shrink-0 text-xs leading-none text-muted-foreground\">\n {l.pageAbbreviation}\n {pageText}\n </span>\n ) : null}\n </PillSurface>\n )\n}\n","import { useCallback, type ReactNode } from 'react'\nimport { MarkMenu, cn, type MarkMenuItem } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/**\n * Quiet inline marks: links, bookmarks, passage references, label and note marks.\n *\n * Each is typographically distinct TEXT (no pill, no button chrome, no icon in the flow) and owns\n * exactly one contextual menu through the shared `MarkMenu`. Domain-neutral: hosts supply the\n * handlers that make a row mean something.\n */\n\n/** Every fixed string of the quiet marks. */\nexport interface QuietMarkLabels {\n openLink: string\n copyLink: string\n linkCopied: string\n copyFailed: string\n jumpHere: string\n copyPlaceLink: string\n openDocument: string\n linkMenu: string\n bookmarkMenu: string\n}\n\nexport const DEFAULT_QUIET_MARK_LABELS: QuietMarkLabels = {\n openLink: 'Open link',\n copyLink: 'Copy link',\n linkCopied: 'Link copied',\n copyFailed: 'Could not copy',\n jumpHere: 'Jump to here',\n copyPlaceLink: 'Copy link to this place',\n openDocument: 'Open document',\n linkMenu: 'Link actions',\n bookmarkMenu: 'Bookmark actions',\n}\n\n/**\n * Copy text to the clipboard and say so (or say it failed) through the host's `notify`. Resolves\n * whether it was copied.\n */\nexport function useCopyText(labels?: Partial<Pick<QuietMarkLabels, 'linkCopied' | 'copyFailed'>>) {\n const { notify } = useBlocksEnvironment()\n const done = labels?.linkCopied ?? DEFAULT_QUIET_MARK_LABELS.linkCopied\n const failed = labels?.copyFailed ?? DEFAULT_QUIET_MARK_LABELS.copyFailed\n return useCallback(\n async (text: string, message?: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(text)\n notify(message ?? done, 'success')\n return true\n } catch {\n notify(failed, 'error')\n return false\n }\n },\n [notify, done, failed]\n )\n}\n\nexport type QuietLinkKind = 'external' | 'anchor' | 'document'\n\nexport interface QuietLinkProps {\n href?: string\n /** `external` (default) opens elsewhere, `anchor` jumps within the page, `document` is an in-app target. */\n kind?: QuietLinkKind\n /** The primary action. Defaults: external opens a new tab, anchor scrolls to the id. */\n onOpen?: () => void\n /** Absolute URL a copied anchor should carry; defaults to the current page plus the hash. */\n placeLink?: string\n labels?: Partial<QuietMarkLabels>\n className?: string\n testId?: string\n children: ReactNode\n}\n\nconst LINK_STYLE: Record<QuietLinkKind, string> = {\n external:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n document:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n // A bookmark is nearly invisible until hovered or focused.\n anchor:\n 'text-inherit underline decoration-dotted decoration-1 decoration-foreground/25 underline-offset-[3px] transition-colors hover:decoration-foreground/70 focus-visible:decoration-foreground/70',\n}\n\nfunction scrollToHash(href: string | undefined) {\n const id = href?.startsWith('#') ? decodeURIComponent(href.slice(1)) : ''\n document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' })\n}\n\n/** A hyperlink, bookmark or document link as quiet text with one menu (open / copy). */\nexport function QuietLink({\n href,\n kind = 'external',\n onOpen,\n placeLink,\n labels,\n className,\n testId,\n children,\n}: QuietLinkProps) {\n const l = { ...DEFAULT_QUIET_MARK_LABELS, ...labels }\n const copy = useCopyText(l)\n\n const open =\n onOpen ??\n (kind === 'anchor'\n ? () => scrollToHash(href)\n : () => {\n if (href) window.open(href, '_blank', 'noopener,noreferrer')\n })\n const copyTarget =\n kind === 'anchor'\n ? (placeLink ?? `${window.location.href.split('#')[0]}${href ?? ''}`)\n : (placeLink ?? href ?? '')\n\n const items: MarkMenuItem[] = [\n {\n id: 'open',\n label: kind === 'anchor' ? l.jumpHere : kind === 'document' ? l.openDocument : l.openLink,\n primary: true,\n onSelect: open,\n testId: 'mark-open',\n },\n {\n id: 'copy',\n label: kind === 'anchor' ? l.copyPlaceLink : l.copyLink,\n onSelect: () => void copy(copyTarget),\n testId: 'mark-copy',\n },\n ]\n\n return (\n <MarkMenu\n as=\"a\"\n href={href}\n items={items}\n menuLabel={kind === 'anchor' ? l.bookmarkMenu : l.linkMenu}\n preview={\n kind === 'external' && href ? (\n <span className=\"block break-all text-xs text-muted-foreground\">{href}</span>\n ) : undefined\n }\n className={cn(LINK_STYLE[kind], 'cursor-pointer', className)}\n testId={testId}\n data-mark-kind={kind}\n >\n {children}\n </MarkMenu>\n )\n}\n\nexport interface PassageMarkProps {\n /** The reference as plain text, e.g. \"¶4\" or \"¶4–9 · p.1\". */\n label: string\n menuLabel: string\n /** Menu rows: copy, link, label, open in navigator. */\n items: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/** A passage's reference as a faint text mark in the margin; its menu carries the passage actions. */\nexport function PassageMark({ label, menuLabel, items, className, testId }: PassageMarkProps) {\n return (\n <MarkMenu\n items={items}\n menuLabel={menuLabel}\n testId={testId}\n data-mark-kind=\"passage\"\n className={cn(\n 'touch-hit cursor-pointer select-none rounded-sm px-1 text-xs tabular-nums text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-2',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n\nexport interface LabelMarkProps {\n /** Colours of every label marking the passage. */\n colors: string[]\n menuLabel: string\n /** Names of the labels, shown in the menu. */\n preview?: ReactNode\n items: MarkMenuItem[]\n /** Accessible name of the stripes. */\n name: string\n className?: string\n testId?: string\n}\n\n/** The labels on a passage as thin margin stripes (not a chip); the menu shows / removes them. */\nexport function LabelMark({\n colors,\n menuLabel,\n preview,\n items,\n name,\n className,\n testId,\n}: LabelMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={preview}\n menuLabel={menuLabel}\n testId={testId}\n aria-label={name}\n data-mark-kind=\"label\"\n className={cn(\n 'flex cursor-pointer flex-col gap-1 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-1',\n className\n )}\n >\n {colors.slice(0, 4).map((c, i) => (\n <span\n key={i}\n aria-hidden=\"true\"\n className=\"h-2.5 w-1 rounded-full\"\n style={{ backgroundColor: c }}\n />\n ))}\n </MarkMenu>\n )\n}\n\nexport interface NoteMarkProps {\n /** Short label, e.g. the passage range this run covers (\"¶4–9\"). */\n label: string\n /** Full note text, shown as the menu preview so the mark is self-explaining. */\n title?: string\n menuLabel?: string\n /** Rows such as \"Show note\" and \"Edit\". With none, the menu is a read-only preview. */\n items?: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/**\n * Marks a passage as cited by a Note: small text with a soft yellow underline, drawn once on\n * each CONTIGUOUS run of cited passages (a run is one citation).\n */\nexport function NoteMark({\n label,\n title,\n menuLabel = 'Note actions',\n items = [],\n className,\n testId,\n}: NoteMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={\n title ? <span className=\"block text-xs text-muted-foreground\">{title}</span> : undefined\n }\n menuLabel={menuLabel}\n testId={testId}\n data-slot=\"note-mark\"\n data-mark-kind=\"note\"\n className={cn(\n 'cursor-default select-none rounded-sm px-1 text-xs font-medium tabular-nums text-foreground/80 underline decoration-yellow-400 decoration-2 underline-offset-[3px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { FoldSection, QuickActionDialogHeader, AddFilesFirst, StartTiles, ScopePicker } from './chunk-V576JOF4.js';
2
+ import { FoldSection, QuickActionDialogHeader, AddFilesFirst, StartTiles, ScopePicker } from './chunk-AAWF27UG.js';
3
3
  import { TriStateFilterMenu } from './chunk-G4GLDQLY.js';
4
4
  import { SelectionBar, SelectionBarAction } from './chunk-NUNKSZKU.js';
5
5
  import { useControllableState } from './chunk-RLWIUUQ5.js';
@@ -1604,5 +1604,5 @@ function WorkflowsTable(props) {
1604
1604
  var GRID_OPTIONS = { suppressClickEdit: true };
1605
1605
 
1606
1606
  export { AgentSelect, DEFAULT_AGENT_SELECT_LABELS, DEFAULT_SCHEMA_FORM_LABELS, DEFAULT_TASK_TRIGGER_CHIP_LABELS, DEFAULT_WORKFLOW_CONFIG_DIALOG_LABELS, DEFAULT_WORKFLOW_DOCUMENTS_FIELD_LABELS, DEFAULT_WORKFLOW_LIST_LABELS, PersonPill, SchemaForm, TaskTriggerChip, WORKFLOW_COLUMN_ORDER, WorkflowConfigDialog, WorkflowDocumentsField, WorkflowLauncher, WorkflowsTable, buildWorkflowScopeSource, createWorkflowColumns, documentScopeLabels, hasTrigger, isSkillRow, matchWorkflowScope, workflowRunStatusLabel, workflowStatus, workflowTriggerType };
1607
- //# sourceMappingURL=chunk-YTK5EU5U.js.map
1608
- //# sourceMappingURL=chunk-YTK5EU5U.js.map
1607
+ //# sourceMappingURL=chunk-7HCHMQOH.js.map
1608
+ //# sourceMappingURL=chunk-7HCHMQOH.js.map