@arbidocs/blocks 0.5.139 → 0.5.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ConnectedCallDock-L27WYW4Y.cjs → ConnectedCallDock-ZNS5BS2R.cjs} +20 -20
- package/dist/{ConnectedCallDock-L27WYW4Y.cjs.map → ConnectedCallDock-ZNS5BS2R.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-ZXSS6CVG.cjs → ConnectedCallRoom-ACNVSFH7.cjs} +13 -13
- package/dist/{ConnectedCallRoom-ZXSS6CVG.cjs.map → ConnectedCallRoom-ACNVSFH7.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-X2O5OIYZ.cjs → ConnectedNativeDocxComparison-QKY66ZJ7.cjs} +18 -18
- package/dist/{ConnectedNativeDocxComparison-X2O5OIYZ.cjs.map → ConnectedNativeDocxComparison-QKY66ZJ7.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-XVCFF25X.cjs → ConnectedPresentation-3JXN6SRT.cjs} +17 -17
- package/dist/{ConnectedPresentation-XVCFF25X.cjs.map → ConnectedPresentation-3JXN6SRT.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-UG2NUFPS.cjs → ConnectedSlidesTab-IECS2MJI.cjs} +15 -15
- package/dist/{ConnectedSlidesTab-UG2NUFPS.cjs.map → ConnectedSlidesTab-IECS2MJI.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-BI6WFIAW.cjs → ConnectedStreamedWordArtifact-PHEOVHKH.cjs} +18 -18
- package/dist/{ConnectedStreamedWordArtifact-BI6WFIAW.cjs.map → ConnectedStreamedWordArtifact-PHEOVHKH.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-NZCGQ7SH.cjs → DocumentReviewCard-ENCPTGJE.cjs} +16 -16
- package/dist/{DocumentReviewCard-NZCGQ7SH.cjs.map → DocumentReviewCard-ENCPTGJE.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-NKDVTI6H.cjs → FilesViewerDialog-OFUBS5VA.cjs} +42 -42
- package/dist/{FilesViewerDialog-NKDVTI6H.cjs.map → FilesViewerDialog-OFUBS5VA.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-KM6U4ZLA.cjs → NativeDocxEditor-7A3SYDAJ.cjs} +6 -6
- package/dist/{NativeDocxEditor-KM6U4ZLA.cjs.map → NativeDocxEditor-7A3SYDAJ.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-B5FAVVVA.cjs → WorkspaceTableView-A2YTG4OQ.cjs} +9 -9
- package/dist/{WorkspaceTableView-B5FAVVVA.cjs.map → WorkspaceTableView-A2YTG4OQ.cjs.map} +1 -1
- package/dist/agents/index.cjs +296 -296
- package/dist/{ai-XVDR2XYV.cjs → ai-QEXZ4SYR.cjs} +25 -25
- package/dist/ai-QEXZ4SYR.cjs.map +1 -0
- package/dist/calls/index.cjs +120 -120
- package/dist/{chunk-SHGUTM42.cjs → chunk-2EY52GDM.cjs} +11 -11
- package/dist/{chunk-SHGUTM42.cjs.map → chunk-2EY52GDM.cjs.map} +1 -1
- package/dist/{chunk-FYNNNQ6H.cjs → chunk-33GOYI3O.cjs} +4 -4
- package/dist/{chunk-FYNNNQ6H.cjs.map → chunk-33GOYI3O.cjs.map} +1 -1
- package/dist/{chunk-RJE6KXJQ.cjs → chunk-6CGMSJLB.cjs} +3 -3
- package/dist/{chunk-RJE6KXJQ.cjs.map → chunk-6CGMSJLB.cjs.map} +1 -1
- package/dist/{chunk-C6DF6WB2.cjs → chunk-6JLRF7N6.cjs} +4 -3
- package/dist/chunk-6JLRF7N6.cjs.map +1 -0
- package/dist/{chunk-L62EU3TQ.cjs → chunk-A53YMUOX.cjs} +3 -3
- package/dist/{chunk-L62EU3TQ.cjs.map → chunk-A53YMUOX.cjs.map} +1 -1
- package/dist/{chunk-N5UI363Q.cjs → chunk-ECSOXKJQ.cjs} +3 -3
- package/dist/{chunk-N5UI363Q.cjs.map → chunk-ECSOXKJQ.cjs.map} +1 -1
- package/dist/{chunk-Q77OKXYM.cjs → chunk-EYXU32D7.cjs} +6 -6
- package/dist/{chunk-Q77OKXYM.cjs.map → chunk-EYXU32D7.cjs.map} +1 -1
- package/dist/{chunk-REP5GA2Z.cjs → chunk-FRRF2OQ7.cjs} +11 -11
- package/dist/{chunk-REP5GA2Z.cjs.map → chunk-FRRF2OQ7.cjs.map} +1 -1
- package/dist/{chunk-3Y75LUCT.cjs → chunk-HZG4GRDA.cjs} +3 -3
- package/dist/{chunk-3Y75LUCT.cjs.map → chunk-HZG4GRDA.cjs.map} +1 -1
- package/dist/{chunk-EY23TOPI.cjs → chunk-IFJBE7M5.cjs} +11 -11
- package/dist/{chunk-EY23TOPI.cjs.map → chunk-IFJBE7M5.cjs.map} +1 -1
- package/dist/{chunk-DBGBAD4J.cjs → chunk-INNHU46B.cjs} +4 -4
- package/dist/{chunk-DBGBAD4J.cjs.map → chunk-INNHU46B.cjs.map} +1 -1
- package/dist/{chunk-SS7IYHLK.cjs → chunk-IZNSTFAT.cjs} +69 -69
- package/dist/{chunk-SS7IYHLK.cjs.map → chunk-IZNSTFAT.cjs.map} +1 -1
- package/dist/{chunk-RYVZDFVO.cjs → chunk-JJZOL5MG.cjs} +3 -3
- package/dist/{chunk-RYVZDFVO.cjs.map → chunk-JJZOL5MG.cjs.map} +1 -1
- package/dist/{chunk-BT2QTDZ4.cjs → chunk-KP7BQIZL.cjs} +35 -35
- package/dist/{chunk-BT2QTDZ4.cjs.map → chunk-KP7BQIZL.cjs.map} +1 -1
- package/dist/{chunk-LWWPIYFD.cjs → chunk-LFMOQALU.cjs} +48 -48
- package/dist/{chunk-LWWPIYFD.cjs.map → chunk-LFMOQALU.cjs.map} +1 -1
- package/dist/{chunk-JXZM5ODS.cjs → chunk-MBXXWTKT.cjs} +28 -28
- package/dist/{chunk-JXZM5ODS.cjs.map → chunk-MBXXWTKT.cjs.map} +1 -1
- package/dist/{chunk-EHFSR633.cjs → chunk-MEYQLQWS.cjs} +13 -13
- package/dist/{chunk-EHFSR633.cjs.map → chunk-MEYQLQWS.cjs.map} +1 -1
- package/dist/{chunk-2WHI2PAJ.cjs → chunk-N2YDYEUL.cjs} +6 -6
- package/dist/{chunk-2WHI2PAJ.cjs.map → chunk-N2YDYEUL.cjs.map} +1 -1
- package/dist/{chunk-PA7YEXL3.cjs → chunk-N3H3YAKY.cjs} +4 -4
- package/dist/{chunk-PA7YEXL3.cjs.map → chunk-N3H3YAKY.cjs.map} +1 -1
- package/dist/{chunk-TKWYFNWW.cjs → chunk-NGPYPW7M.cjs} +62 -60
- package/dist/chunk-NGPYPW7M.cjs.map +1 -0
- package/dist/{chunk-FDRZJFNV.cjs → chunk-O6OLY43S.cjs} +5 -5
- package/dist/{chunk-FDRZJFNV.cjs.map → chunk-O6OLY43S.cjs.map} +1 -1
- package/dist/{chunk-KZWPBL2P.cjs → chunk-OOW7H2YD.cjs} +6 -6
- package/dist/{chunk-KZWPBL2P.cjs.map → chunk-OOW7H2YD.cjs.map} +1 -1
- package/dist/{chunk-YEGOCUBR.cjs → chunk-ORQXGMCC.cjs} +15 -15
- package/dist/{chunk-YEGOCUBR.cjs.map → chunk-ORQXGMCC.cjs.map} +1 -1
- package/dist/chunk-QCC57APO.cjs +18 -0
- package/dist/{chunk-SUPCMKLP.cjs.map → chunk-QCC57APO.cjs.map} +1 -1
- package/dist/{chunk-DT4ORVVI.cjs → chunk-QFXOTJ6G.cjs} +3 -3
- package/dist/{chunk-DT4ORVVI.cjs.map → chunk-QFXOTJ6G.cjs.map} +1 -1
- package/dist/{chunk-G7E5IJST.cjs → chunk-QW6NCUR7.cjs} +5 -5
- package/dist/{chunk-G7E5IJST.cjs.map → chunk-QW6NCUR7.cjs.map} +1 -1
- package/dist/{chunk-CKKODA5B.cjs → chunk-R5NTEW4L.cjs} +26 -26
- package/dist/{chunk-CKKODA5B.cjs.map → chunk-R5NTEW4L.cjs.map} +1 -1
- package/dist/{chunk-F5HT73TR.cjs → chunk-RGSFPWG2.cjs} +50 -50
- package/dist/{chunk-F5HT73TR.cjs.map → chunk-RGSFPWG2.cjs.map} +1 -1
- package/dist/{chunk-K3WSXEEI.cjs → chunk-RSQGDXAF.cjs} +3 -3
- package/dist/{chunk-K3WSXEEI.cjs.map → chunk-RSQGDXAF.cjs.map} +1 -1
- package/dist/{chunk-6JI4AXAY.cjs → chunk-TOYKBRAU.cjs} +12 -12
- package/dist/{chunk-6JI4AXAY.cjs.map → chunk-TOYKBRAU.cjs.map} +1 -1
- package/dist/{chunk-CYA7MDHZ.cjs → chunk-TXBXIUTX.cjs} +6 -6
- package/dist/{chunk-CYA7MDHZ.cjs.map → chunk-TXBXIUTX.cjs.map} +1 -1
- package/dist/{chunk-RDBUQCAS.cjs → chunk-U6XMZG6G.cjs} +3 -3
- package/dist/{chunk-RDBUQCAS.cjs.map → chunk-U6XMZG6G.cjs.map} +1 -1
- package/dist/{chunk-LYDPVFNS.cjs → chunk-UD56Y6UA.cjs} +4 -4
- package/dist/{chunk-LYDPVFNS.cjs.map → chunk-UD56Y6UA.cjs.map} +1 -1
- package/dist/{chunk-DNWJUTK6.cjs → chunk-UWTCK5IN.cjs} +6 -6
- package/dist/{chunk-DNWJUTK6.cjs.map → chunk-UWTCK5IN.cjs.map} +1 -1
- package/dist/{chunk-7HU2NQVO.cjs → chunk-VCDD763Y.cjs} +3 -3
- package/dist/{chunk-7HU2NQVO.cjs.map → chunk-VCDD763Y.cjs.map} +1 -1
- package/dist/{chunk-HG72AVXX.cjs → chunk-VF26CUE3.cjs} +3 -3
- package/dist/{chunk-HG72AVXX.cjs.map → chunk-VF26CUE3.cjs.map} +1 -1
- package/dist/{chunk-7YIN4Q63.cjs → chunk-X46QYO4S.cjs} +4 -4
- package/dist/{chunk-7YIN4Q63.cjs.map → chunk-X46QYO4S.cjs.map} +1 -1
- package/dist/{chunk-N7B5OAI5.cjs → chunk-ZPIZINH2.cjs} +4 -4
- package/dist/{chunk-N7B5OAI5.cjs.map → chunk-ZPIZINH2.cjs.map} +1 -1
- package/dist/{chunk-RFPZKHZ6.cjs → chunk-ZTHYJP4G.cjs} +7 -7
- package/dist/{chunk-RFPZKHZ6.cjs.map → chunk-ZTHYJP4G.cjs.map} +1 -1
- package/dist/connect/docx.cjs +22 -22
- package/dist/connect/index.cjs +1088 -1029
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +30 -30
- package/dist/connection/billing/ChangeProPlan.d.ts +1 -1
- package/dist/connection/billing/ChangeProPlan.js +9 -3
- package/dist/connection/billing/ChangeProPlan.js.map +2 -2
- package/dist/connection/billing/ConnectedPricesPrefetch.d.ts +1 -0
- package/dist/connection/billing/ConnectedPricesPrefetch.js +12 -0
- package/dist/connection/billing/ConnectedPricesPrefetch.js.map +7 -0
- package/dist/connection/billing/ConnectedWelcomeDialog.js +21 -3
- package/dist/connection/billing/ConnectedWelcomeDialog.js.map +2 -2
- package/dist/connection/billing/NewProjectFlow.js +3 -14
- package/dist/connection/billing/NewProjectFlow.js.map +2 -2
- package/dist/connection/billing/PlanPricesSkeleton.d.ts +3 -0
- package/dist/connection/billing/PlanPricesSkeleton.js +40 -0
- package/dist/connection/billing/PlanPricesSkeleton.js.map +7 -0
- package/dist/connection/billing/SubscriptionPlans.d.ts +1 -1
- package/dist/connection/billing/SubscriptionPlans.js +19 -6
- package/dist/connection/billing/SubscriptionPlans.js.map +2 -2
- package/dist/connection/billing/index.d.ts +1 -0
- package/dist/connection/billing/index.js +2 -0
- package/dist/connection/billing/index.js.map +2 -2
- package/dist/connection/notification-center/NotificationEvent.js +1 -1
- package/dist/connection/notification-center/NotificationEvent.js.map +1 -1
- package/dist/connection/viewer/useViewerBlobs.d.ts +3 -3
- package/dist/connection/viewer/useViewerBlobs.js +3 -1
- package/dist/connection/viewer/useViewerBlobs.js.map +2 -2
- package/dist/dashboards/index.cjs +1 -1
- package/dist/docx/index.cjs +38 -38
- package/dist/docx/review/DocxEditorReview.js +2 -1
- package/dist/docx/review/DocxEditorReview.js.map +2 -2
- package/dist/embed/index.cjs +37 -37
- package/dist/facts/index.cjs +43 -43
- package/dist/files/index.cjs +224 -224
- package/dist/index.cjs +1698 -1698
- package/dist/settings/WelcomeDialog.d.ts +1 -1
- package/dist/settings/WelcomeDialog.js.map +1 -1
- package/dist/settings/index.cjs +147 -147
- package/dist/shell/index.cjs +87 -87
- package/dist/studio/index.cjs +29 -29
- package/dist/styles.css +1 -1
- package/dist/vite/index.cjs +11 -10
- package/dist/vite/index.cjs.map +1 -1
- package/dist/vite/index.d.ts +4 -13
- package/dist/vite/index.js +11 -10
- package/dist/vite/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +54 -54
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ai-XVDR2XYV.cjs.map +0 -1
- package/dist/chunk-C6DF6WB2.cjs.map +0 -1
- package/dist/chunk-SUPCMKLP.cjs +0 -18
- package/dist/chunk-TKWYFNWW.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/billing/SubscriptionPlans.tsx"],
|
|
4
|
-
"sourcesContent": ["/** The base subscription is chosen here; usage limits are approved after payment. */\nimport { useState } from 'react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ArrowRight } from 'lucide-react'\nimport { PlanNotice } from '../../settings'\nimport { useProducts } from '@arbidocs/react'\nimport { StripeCheckoutModal } from './StripeCheckoutModal'\nimport { ProjectPurchaseOptions } from './ProjectPurchaseOptions'\nimport { findProPrices, type PlanInterval } from './plan-pricing'\nimport type { TaxQuote } from './tax-quote'\nimport type { components } from '@arbidocs/client'\n\ninterface SubscriptionPlansProps {\n projectExtId: string\n currentQuotas?: components['schemas']['ProjectQuotas']\n onDismiss?: () => void\n onCompleted?: () => void\n enabled?: boolean\n}\n\nexport function SubscriptionPlans({\n projectExtId,\n currentQuotas,\n onDismiss,\n onCompleted,\n enabled = true,\n}: SubscriptionPlansProps) {\n const { data: products
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["/** The base subscription is chosen here; usage limits are approved after payment. */\nimport { useState } from 'react'\nimport { Button } from '@arbidocs/react/ui'\nimport { ArrowRight } from 'lucide-react'\nimport { PlanNotice } from '../../settings'\nimport { useProducts } from '@arbidocs/react'\nimport { PlanPricesSkeleton } from './PlanPricesSkeleton'\nimport { useBillingSupport } from './support'\nimport { StripeCheckoutModal } from './StripeCheckoutModal'\nimport { ProjectPurchaseOptions } from './ProjectPurchaseOptions'\nimport { findProPrices, type PlanInterval } from './plan-pricing'\nimport type { TaxQuote } from './tax-quote'\nimport type { components } from '@arbidocs/client'\n\ninterface SubscriptionPlansProps {\n projectExtId: string\n currentQuotas?: components['schemas']['ProjectQuotas']\n onDismiss?: () => void\n onCompleted?: () => void\n enabled?: boolean\n}\n\nexport function SubscriptionPlans({\n projectExtId,\n currentQuotas,\n onDismiss,\n onCompleted,\n enabled = true,\n}: SubscriptionPlansProps) {\n const { stripeEnabled } = useBillingSupport()\n const {\n data: products,\n isPending,\n error,\n refetch,\n } = useProducts({ enabled: enabled && stripeEnabled })\n const [promoCode, setPromoCode] = useState('')\n const [checkout, setCheckout] = useState<{\n interval: PlanInterval\n quote?: TaxQuote\n promoCode?: string\n } | null>(null)\n const [checkoutOpen, setCheckoutOpen] = useState(false)\n // A deployment that does not sell plans has no chooser, and so nothing to load or fail.\n if (!stripeEnabled) return null\n // Pending (not yet asked, not yet signed in, or in flight) is loading, never \"empty\".\n if (isPending) return <PlanPricesSkeleton />\n if (error || !products?.length)\n return (\n <div className=\"space-y-3\">\n <PlanNotice tone={error ? 'error' : undefined}>\n {error ? \"Prices didn't load. Try again.\" : 'No subscriptions available.'}\n </PlanNotice>\n <div className=\"flex flex-wrap gap-2\">\n {error && (\n <Button type=\"button\" variant=\"outline\" onClick={() => void refetch()}>\n Try again\n </Button>\n )}\n {onDismiss && (\n <Button type=\"button\" variant=\"outline\" onClick={onDismiss}>\n Stay on Free <ArrowRight aria-hidden=\"true\" size={16} />\n </Button>\n )}\n </div>\n </div>\n )\n return (\n <>\n <ProjectPurchaseOptions\n products={products}\n projectExtId={projectExtId}\n currentQuotas={currentQuotas}\n enabled={enabled}\n promoCode={promoCode}\n onPromoCodeChange={setPromoCode}\n onChooseFree={onDismiss}\n onChoose={(interval, _cap, quote) => {\n setCheckout({ interval, quote, promoCode: promoCode.trim() || undefined })\n setCheckoutOpen(true)\n }}\n />\n {checkout && (\n <StripeCheckoutModal\n promoCode={checkout.promoCode}\n price={findProPrices(products)[checkout.interval === 'year' ? 'annual' : 'monthly']}\n projectExtId={projectExtId}\n interval={checkout.interval}\n addonBudgetPence={0}\n requireSpendLimitConfirmation\n quote={checkout.quote}\n open={checkoutOpen}\n onOpenChange={setCheckoutOpen}\n onCompleted={onCompleted ?? onDismiss}\n />\n )}\n </>\n )\n}\n"],
|
|
5
|
+
"mappings": ";AA8CwB,SAsBpB,UAtBoB,KAcZ,YAdY;AA7CxB,SAAS,gBAAgB;AACzB,SAAS,cAAc;AACvB,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,mBAAmB;AAC5B,SAAS,0BAA0B;AACnC,SAAS,yBAAyB;AAClC,SAAS,2BAA2B;AACpC,SAAS,8BAA8B;AACvC,SAAS,qBAAwC;AAY1C,SAAS,kBAAkB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,UAAU;AACZ,GAA2B;AACzB,QAAM,EAAE,cAAc,IAAI,kBAAkB;AAC5C,QAAM;AAAA,IACJ,MAAM;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,YAAY,EAAE,SAAS,WAAW,cAAc,CAAC;AACrD,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAC7C,QAAM,CAAC,UAAU,WAAW,IAAI,SAItB,IAAI;AACd,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,KAAK;AAEtD,MAAI,CAAC,c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_BUDGET_MESSAGE, isAddonBudgetZero } from './addon-pricing';
|
|
22
22
|
export { ConnectedQuotaDialog, type ConnectedQuotaDialogProps, type QuotaExceededInfo, } from './ConnectedQuotaDialog';
|
|
23
23
|
export { createPaymentRequiredMiddleware, openQuotaDialogIfUsedUp, paymentConfirmationUrl, paymentRequiredToastMessage, routePaymentRequired, surfacePaymentRequired, type PaymentRequiredOptions, type PaymentRequiredRoute, } from './payment-required';
|
|
24
|
+
export { ConnectedPricesPrefetch } from './ConnectedPricesPrefetch';
|
|
24
25
|
export { ConnectedWelcomeDialog, type ConnectedWelcomeDialogProps } from './ConnectedWelcomeDialog';
|
|
25
26
|
export { ProjectUsageContent, type ProjectUsageContentProps, type UsageBreakdownKey, } from './ProjectUsageContent';
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
routePaymentRequired,
|
|
30
30
|
surfacePaymentRequired
|
|
31
31
|
} from "./payment-required.js";
|
|
32
|
+
import { ConnectedPricesPrefetch } from "./ConnectedPricesPrefetch.js";
|
|
32
33
|
import { ConnectedWelcomeDialog } from "./ConnectedWelcomeDialog.js";
|
|
33
34
|
import {
|
|
34
35
|
ProjectUsageContent
|
|
@@ -37,6 +38,7 @@ export {
|
|
|
37
38
|
AddAddonDialog,
|
|
38
39
|
CAP_REACHED_MESSAGE,
|
|
39
40
|
ChangePlanDialog,
|
|
41
|
+
ConnectedPricesPrefetch,
|
|
40
42
|
ConnectedQuotaDialog,
|
|
41
43
|
ConnectedWelcomeDialog,
|
|
42
44
|
InvoicesModal,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/billing/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The billing kit: a host's projects (plan, usage, add-ons, invoices), the plan picker and checkout,\n * new projects, and the projects shared with the user. Stripe stays the host's (the host\n * configuration's `billing`); without it projects show their limits and usage only.\n */\nexport { useBillingSupport, type BillingSupport, type BillingCheckoutSupport } from './support'\nexport {\n requestProjectBillingFocus,\n useProjectBillingFocus,\n type ProjectBillingFocus,\n} from './billing-focus'\nexport { ProjectsTable } from './ProjectsTable'\nexport { SharedProjects } from './SharedProjects'\nexport { ProjectDetail, type ProjectDetailProps } from './ProjectDetail'\nexport { NewProjectFlow } from './NewProjectFlow'\nexport { ChangePlanDialog } from './ChangePlanDialog'\nexport { AddAddonDialog } from './AddAddonDialog'\nexport { InvoicesModal } from './InvoicesModal'\nexport { useOpenBillingPortal } from './useOpenBillingPortal'\nexport { useAutoRefreshPendingProjects } from './useAutoRefreshPendingProjects'\nexport { formatMoney, useRewardBalance, type RewardBalance } from './reward-balance'\nexport { useReferralOffer, useReferralReward } from './referral-reward'\nexport { isProProject, planBadgeView, planName } from './plan-badge'\nexport { aiUsageResetTimestamp, formatResetDate, getQuotaItems } from './quota-items'\nexport { CAP_REACHED_MESSAGE, ZERO_BUDGET_MESSAGE, isAddonBudgetZero } from './addon-pricing'\nexport {\n ConnectedQuotaDialog,\n type ConnectedQuotaDialogProps,\n type QuotaExceededInfo,\n} from './ConnectedQuotaDialog'\nexport {\n createPaymentRequiredMiddleware,\n openQuotaDialogIfUsedUp,\n paymentConfirmationUrl,\n paymentRequiredToastMessage,\n routePaymentRequired,\n surfacePaymentRequired,\n type PaymentRequiredOptions,\n type PaymentRequiredRoute,\n} from './payment-required'\nexport { ConnectedWelcomeDialog, type ConnectedWelcomeDialogProps } from './ConnectedWelcomeDialog'\nexport {\n ProjectUsageContent,\n type ProjectUsageContentProps,\n type UsageBreakdownKey,\n} from './ProjectUsageContent'\n"],
|
|
5
|
-
"mappings": ";AAKA,SAAS,yBAA2E;AACpF;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,qBAA8C;AACvD,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,qCAAqC;AAC9C,SAAS,aAAa,wBAA4C;AAClE,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,cAAc,eAAe,gBAAgB;AACtD,SAAS,uBAAuB,iBAAiB,qBAAqB;AACtE,SAAS,qBAAqB,qBAAqB,yBAAyB;AAC5E;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,8BAAgE;AACzE;AAAA,EACE;AAAA,OAGK;",
|
|
4
|
+
"sourcesContent": ["/**\n * The billing kit: a host's projects (plan, usage, add-ons, invoices), the plan picker and checkout,\n * new projects, and the projects shared with the user. Stripe stays the host's (the host\n * configuration's `billing`); without it projects show their limits and usage only.\n */\nexport { useBillingSupport, type BillingSupport, type BillingCheckoutSupport } from './support'\nexport {\n requestProjectBillingFocus,\n useProjectBillingFocus,\n type ProjectBillingFocus,\n} from './billing-focus'\nexport { ProjectsTable } from './ProjectsTable'\nexport { SharedProjects } from './SharedProjects'\nexport { ProjectDetail, type ProjectDetailProps } from './ProjectDetail'\nexport { NewProjectFlow } from './NewProjectFlow'\nexport { ChangePlanDialog } from './ChangePlanDialog'\nexport { AddAddonDialog } from './AddAddonDialog'\nexport { InvoicesModal } from './InvoicesModal'\nexport { useOpenBillingPortal } from './useOpenBillingPortal'\nexport { useAutoRefreshPendingProjects } from './useAutoRefreshPendingProjects'\nexport { formatMoney, useRewardBalance, type RewardBalance } from './reward-balance'\nexport { useReferralOffer, useReferralReward } from './referral-reward'\nexport { isProProject, planBadgeView, planName } from './plan-badge'\nexport { aiUsageResetTimestamp, formatResetDate, getQuotaItems } from './quota-items'\nexport { CAP_REACHED_MESSAGE, ZERO_BUDGET_MESSAGE, isAddonBudgetZero } from './addon-pricing'\nexport {\n ConnectedQuotaDialog,\n type ConnectedQuotaDialogProps,\n type QuotaExceededInfo,\n} from './ConnectedQuotaDialog'\nexport {\n createPaymentRequiredMiddleware,\n openQuotaDialogIfUsedUp,\n paymentConfirmationUrl,\n paymentRequiredToastMessage,\n routePaymentRequired,\n surfacePaymentRequired,\n type PaymentRequiredOptions,\n type PaymentRequiredRoute,\n} from './payment-required'\nexport { ConnectedPricesPrefetch } from './ConnectedPricesPrefetch'\nexport { ConnectedWelcomeDialog, type ConnectedWelcomeDialogProps } from './ConnectedWelcomeDialog'\nexport {\n ProjectUsageContent,\n type ProjectUsageContentProps,\n type UsageBreakdownKey,\n} from './ProjectUsageContent'\n"],
|
|
5
|
+
"mappings": ";AAKA,SAAS,yBAA2E;AACpF;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,qBAAqB;AAC9B,SAAS,sBAAsB;AAC/B,SAAS,qBAA8C;AACvD,SAAS,sBAAsB;AAC/B,SAAS,wBAAwB;AACjC,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,SAAS,4BAA4B;AACrC,SAAS,qCAAqC;AAC9C,SAAS,aAAa,wBAA4C;AAClE,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,cAAc,eAAe,gBAAgB;AACtD,SAAS,uBAAuB,iBAAiB,qBAAqB;AACtE,SAAS,qBAAqB,qBAAqB,yBAAyB;AAC5E;AAAA,EACE;AAAA,OAGK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,+BAA+B;AACxC,SAAS,8BAAgE;AACzE;AAAA,EACE;AAAA,OAGK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
signatureNotificationPhrase,
|
|
18
18
|
signatureRequestMeta
|
|
19
19
|
} from "@arbidocs/react";
|
|
20
|
-
const ACTION_CLASS = "ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10";
|
|
20
|
+
const ACTION_CLASS = "relative ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']";
|
|
21
21
|
const PHRASE_CLASS = "min-w-0 shrink-[2] truncate text-sm";
|
|
22
22
|
function ActionButton({ label, onClick }) {
|
|
23
23
|
return /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/notification-center/NotificationEvent.tsx"],
|
|
4
|
-
"sourcesContent": ["/**\n * The Event cell of the notification centre: what happened, as a sentence around the people and\n * documents involved, with the action that opens it. A received notification reads from the\n * recipient's side (\"[Priya] mentioned you in a conversation\"), a sent one from the sender's\n * (\"You mentioned [Sam] in a conversation\"), a session-log entry as it was toasted.\n */\nimport type { ComponentType, ReactElement, ReactNode } from 'react'\nimport {\n BOX_SEAT_REFUSED,\n BOX_SEAT_REFUSED_TITLE,\n WORK_NOTIFICATION_LABELS,\n describeServerNotification,\n describeCalendarNotification,\n notificationUserName,\n documentActivityPhrase,\n getWorkspaceActionText,\n getWorkspaceSentPhrase,\n inputRequestTitle,\n isDeploymentUserNotification,\n isSignatureNotificationType,\n isWorkspaceNotificationType,\n signatureNotificationPhrase,\n signatureRequestMeta,\n type NotificationTarget,\n type SignatureNotificationType,\n} from '@arbidocs/react'\nimport type { NotificationCenterItem, NotificationRow } from './items'\n\nexport type NotificationUser = NotificationRow['sender']\n\nexport interface NotificationDocumentChipProps {\n documentId: string\n workspaceId?: string | null\n /** Open the document. */\n onOpen: () => void\n /** What to show when the document is not known here (its name is encrypted per workspace). */\n fallback: ReactNode\n}\n\n/** How the host draws people, workspaces and documents in the list. */\nexport interface NotificationCenterRenderers {\n /** A person's pill. */\n renderUser: (user: NotificationUser) => ReactNode\n /** A workspace's badge (the Category of a workspace's notification), or null when the host\n * does not know the workspace (the type's own category shows instead). */\n renderWorkspace: (workspaceId: string) => ReactNode | null\n /** A signature notification's document: its chip when known, else `fallback`. */\n DocumentChip: ComponentType<NotificationDocumentChipProps>\n}\n\nconst ACTION_CLASS =\n 'ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10'\nconst PHRASE_CLASS = 'min-w-0 shrink-[2] truncate text-sm'\n\nfunction ActionButton({ label, onClick }: { label: string; onClick: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick()\n }}\n className={ACTION_CLASS}\n data-testid=\"notification-action-button\"\n >\n {label}\n </button>\n )\n}\n\n/** \"[person] {phrase}\" \u2014 the row line most notifications are. */\nfunction PersonLine({ person, children }: { person: ReactNode; children: ReactNode }) {\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {person}\n {children}\n </div>\n )\n}\n\nfunction SignatureEvent({\n row,\n isIncoming,\n open,\n renderers,\n action,\n}: {\n row: NotificationRow\n isIncoming: boolean\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n /** The row's action (Review and sign), on the document's line. */\n action?: ReactNode\n}): ReactElement {\n const type = row.type as SignatureNotificationType\n const { lead, showPerson, verb, tail } = signatureNotificationPhrase(type, isIncoming)\n const { documentId } = signatureRequestMeta(row.content)\n const target = describeServerNotification(row)?.target\n const openIt = () => target && open(target)\n const { DocumentChip } = renderers\n const unnamed = (\n <>\n <span className=\"min-w-0 truncate text-sm\">\n {type === 'signature_requested' ? 'a document' : 'the document'}\n </span>\n </>\n )\n // Two short lines, so a narrow panel still shows who and which document: the person and what\n // they did, then the document and the action (beside both lines, it left the first one no room). The fixed wording gives way first; the person's name\n // never yields to it.\n const wording = 'min-w-0 shrink-[100] truncate text-sm'\n return (\n <div\n className=\"flex h-full min-w-0 flex-col justify-center gap-0.5 text-muted-foreground\"\n data-testid=\"notification-signature\"\n >\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {lead && <span className={wording}>{lead}</span>}\n {showPerson && (\n <span\n className=\"flex max-w-full min-w-0 shrink-0\"\n data-testid=\"notification-signature-person\"\n >\n {renderers.renderUser(isIncoming ? row.sender : row.recipient)}\n </span>\n )}\n {verb && <span className={wording}>{verb}</span>}\n </div>\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {documentId ? (\n <DocumentChip\n documentId={documentId}\n workspaceId={row.workspace_ext_id}\n onOpen={openIt}\n fallback={unnamed}\n />\n ) : (\n unnamed\n )}\n {tail && <span className={wording}>{tail.trim()}</span>}\n {action}\n </div>\n </div>\n )\n}\n\nfunction PersistedEvent({\n item,\n row,\n open,\n renderers,\n action,\n}: {\n item: NotificationCenterItem\n row: NotificationRow\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n action?: ReactNode\n}): ReactElement {\n const { sender, recipient } = row\n const type = row.type as string\n const isIncoming = item.kind === 'incoming'\n const user = renderers.renderUser\n\n if (type === 'file_shared') {\n const entry = describeServerNotification(row)\n return (\n <div className=\"flex h-full items-center gap-2 text-sm\">\n <span>{entry?.title}</span>\n </div>\n )\n }\n\n // Workspace membership, from the recipient's or sender's perspective.\n if (isWorkspaceNotificationType(type)) {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>{getWorkspaceActionText(type)}</span>\n </PersonLine>\n )\n const { before, after } = getWorkspaceSentPhrase(type)\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>{before}</span>\n {user(recipient)}\n {after && <span className={PHRASE_CLASS}>{after}</span>}\n </div>\n )\n }\n\n if (type === 'contact_accepted') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'accepted your invitation to join the platform'}\n </span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'Accepted an invitation to join the platform'}\n </span>\n </div>\n )\n }\n\n // A workspace access request: received, \"Review\" opens the grant flow.\n if (type === 'workspace_access_request') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>requested workspace access</span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>Requested workspace access from</span>\n {user(recipient)}\n </div>\n )\n }\n\n // A Box admin's notice: someone was invited or joined. Same sentence as the bell and toast,\n // with \"Manage users\" to the portal when the link is a trusted portal URL.\n if (isDeploymentUserNotification(type)) {\n const entry = describeServerNotification(row)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n data-testid=\"notification-deployment-user\"\n >\n <span className=\"min-w-0 truncate\" title={entry?.title}>\n {entry?.title}\n </span>\n </div>\n )\n }\n\n // Self-notifications: a refused Box seat, a signup bonus, a reward.\n const selfLine =\n type === BOX_SEAT_REFUSED\n ? BOX_SEAT_REFUSED_TITLE\n : type === 'signup_reward'\n ? `Signup bonus \u2014 ${row.content || 'You earned a signup bonus'}`\n : type === 'referral_reward'\n ? `Reward earned \u2014 ${row.content || 'You earned a reward'}`\n : null\n if (selfLine)\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n <span className=\"min-w-0 truncate\">{selfLine}</span>\n </div>\n )\n\n // An @mention: name the person and offer \"Open\" to jump to the message.\n if (type === 'mention' || type === 'docx_mention') {\n const inDocument = type === 'docx_mention'\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {!isIncoming && <span className=\"text-sm\">You mentioned</span>}\n {isIncoming ? user(sender) : user(recipient)}\n <span className={PHRASE_CLASS}>\n {inDocument\n ? isIncoming\n ? 'mentioned you in a document comment'\n : 'in a document comment'\n : isIncoming\n ? 'mentioned you in a conversation'\n : 'in a conversation'}\n </span>\n </div>\n )\n }\n\n // A reply in a thread you take part in, or a new version of a document you own. Only\n // received: nobody is sent their own.\n if (type === 'thread_reply' || type === 'document_activity') {\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-muted-foreground\"\n data-testid=\"notification-relevance\"\n >\n {user(sender)}\n <span className={PHRASE_CLASS}>\n {type === 'thread_reply' ? 'replied in a thread' : documentActivityPhrase(row.content)}\n </span>\n </div>\n )\n }\n\n if (isSignatureNotificationType(type))\n return (\n <SignatureEvent\n row={row}\n isIncoming={isIncoming}\n open={open}\n renderers={renderers}\n action={action}\n />\n )\n\n // Work notifications \u2014 a task is a conversation, so the notification links straight to it.\n const workLabel =\n type === 'agent_input_requested'\n ? inputRequestTitle(row.content)\n : WORK_NOTIFICATION_LABELS[type]\n if (workLabel)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n title={workLabel}\n data-testid=\"notification-work\"\n >\n <span className={`min-w-0 truncate ${type === 'workflow_failed' ? 'text-red-text' : ''}`}>\n {workLabel}\n </span>\n </div>\n )\n\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n {(\n describeCalendarNotification(row, { senderName: notificationUserName(row.sender) }) ??\n describeServerNotification(row)\n )?.title ??\n row.content ??\n type ??\n 'Notification'}\n </div>\n )\n}\n\n/** A session-log entry: its message as toasted (+ its action while this session lasts). */\nfunction SessionEvent({\n item,\n open,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n}): ReactElement | null {\n const entry = item.entry\n if (!entry) return null\n return (\n <div\n className=\"flex h-full items-center gap-2 text-sm text-muted-foreground\"\n title={entry.title}\n >\n {entry.html ? (\n <span className=\"min-w-0 truncate\" dangerouslySetInnerHTML={{ __html: entry.html }} />\n ) : (\n <span className=\"min-w-0 truncate\">{entry.title}</span>\n )}\n {(entry.onSelect || entry.href) && (\n <ActionButton\n label={entry.actionLabel ?? 'Open'}\n onClick={() => {\n if (entry.onSelect) entry.onSelect()\n else if (entry.href) open({ kind: 'url', url: entry.href })\n }}\n />\n )}\n </div>\n )\n}\n\nexport function NotificationEvent({\n item,\n open,\n renderers,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n}): ReactElement | null {\n if (!item.persisted) return <SessionEvent item={item} open={open} />\n if (!item.row) return null\n const described =\n describeCalendarNotification(item.row, { senderName: notificationUserName(item.row.sender) }) ??\n describeServerNotification(item.row)\n const action = described?.target && (\n <ActionButton label={described.actionLabel ?? 'Open'} onClick={() => open(described.target!)} />\n )\n // A signature event is two lines: its action goes on the document's line, so the first keeps the\n // room to say who asked and what.\n const ownLine = isSignatureNotificationType(item.row.type as string)\n return (\n <div className=\"flex h-full min-w-0 items-center gap-2\">\n <div className=\"min-w-0 flex-1\">\n <PersistedEvent\n item={item}\n row={item.row}\n open={open}\n renderers={renderers}\n action={ownLine ? action : undefined}\n />\n </div>\n {!ownLine && action}\n </div>\n )\n}\n"],
|
|
4
|
+
"sourcesContent": ["/**\n * The Event cell of the notification centre: what happened, as a sentence around the people and\n * documents involved, with the action that opens it. A received notification reads from the\n * recipient's side (\"[Priya] mentioned you in a conversation\"), a sent one from the sender's\n * (\"You mentioned [Sam] in a conversation\"), a session-log entry as it was toasted.\n */\nimport type { ComponentType, ReactElement, ReactNode } from 'react'\nimport {\n BOX_SEAT_REFUSED,\n BOX_SEAT_REFUSED_TITLE,\n WORK_NOTIFICATION_LABELS,\n describeServerNotification,\n describeCalendarNotification,\n notificationUserName,\n documentActivityPhrase,\n getWorkspaceActionText,\n getWorkspaceSentPhrase,\n inputRequestTitle,\n isDeploymentUserNotification,\n isSignatureNotificationType,\n isWorkspaceNotificationType,\n signatureNotificationPhrase,\n signatureRequestMeta,\n type NotificationTarget,\n type SignatureNotificationType,\n} from '@arbidocs/react'\nimport type { NotificationCenterItem, NotificationRow } from './items'\n\nexport type NotificationUser = NotificationRow['sender']\n\nexport interface NotificationDocumentChipProps {\n documentId: string\n workspaceId?: string | null\n /** Open the document. */\n onOpen: () => void\n /** What to show when the document is not known here (its name is encrypted per workspace). */\n fallback: ReactNode\n}\n\n/** How the host draws people, workspaces and documents in the list. */\nexport interface NotificationCenterRenderers {\n /** A person's pill. */\n renderUser: (user: NotificationUser) => ReactNode\n /** A workspace's badge (the Category of a workspace's notification), or null when the host\n * does not know the workspace (the type's own category shows instead). */\n renderWorkspace: (workspaceId: string) => ReactNode | null\n /** A signature notification's document: its chip when known, else `fallback`. */\n DocumentChip: ComponentType<NotificationDocumentChipProps>\n}\n\nconst ACTION_CLASS =\n \"relative ml-auto flex-shrink-0 rounded-md bg-accent px-2 py-0.5 text-xs font-medium text-primary transition-colors hover:bg-primary/10 pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\nconst PHRASE_CLASS = 'min-w-0 shrink-[2] truncate text-sm'\n\nfunction ActionButton({ label, onClick }: { label: string; onClick: () => void }) {\n return (\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick()\n }}\n className={ACTION_CLASS}\n data-testid=\"notification-action-button\"\n >\n {label}\n </button>\n )\n}\n\n/** \"[person] {phrase}\" \u2014 the row line most notifications are. */\nfunction PersonLine({ person, children }: { person: ReactNode; children: ReactNode }) {\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {person}\n {children}\n </div>\n )\n}\n\nfunction SignatureEvent({\n row,\n isIncoming,\n open,\n renderers,\n action,\n}: {\n row: NotificationRow\n isIncoming: boolean\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n /** The row's action (Review and sign), on the document's line. */\n action?: ReactNode\n}): ReactElement {\n const type = row.type as SignatureNotificationType\n const { lead, showPerson, verb, tail } = signatureNotificationPhrase(type, isIncoming)\n const { documentId } = signatureRequestMeta(row.content)\n const target = describeServerNotification(row)?.target\n const openIt = () => target && open(target)\n const { DocumentChip } = renderers\n const unnamed = (\n <>\n <span className=\"min-w-0 truncate text-sm\">\n {type === 'signature_requested' ? 'a document' : 'the document'}\n </span>\n </>\n )\n // Two short lines, so a narrow panel still shows who and which document: the person and what\n // they did, then the document and the action (beside both lines, it left the first one no room). The fixed wording gives way first; the person's name\n // never yields to it.\n const wording = 'min-w-0 shrink-[100] truncate text-sm'\n return (\n <div\n className=\"flex h-full min-w-0 flex-col justify-center gap-0.5 text-muted-foreground\"\n data-testid=\"notification-signature\"\n >\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {lead && <span className={wording}>{lead}</span>}\n {showPerson && (\n <span\n className=\"flex max-w-full min-w-0 shrink-0\"\n data-testid=\"notification-signature-person\"\n >\n {renderers.renderUser(isIncoming ? row.sender : row.recipient)}\n </span>\n )}\n {verb && <span className={wording}>{verb}</span>}\n </div>\n <div className=\"flex min-w-0 items-center gap-1.5 leading-5\">\n {documentId ? (\n <DocumentChip\n documentId={documentId}\n workspaceId={row.workspace_ext_id}\n onOpen={openIt}\n fallback={unnamed}\n />\n ) : (\n unnamed\n )}\n {tail && <span className={wording}>{tail.trim()}</span>}\n {action}\n </div>\n </div>\n )\n}\n\nfunction PersistedEvent({\n item,\n row,\n open,\n renderers,\n action,\n}: {\n item: NotificationCenterItem\n row: NotificationRow\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n action?: ReactNode\n}): ReactElement {\n const { sender, recipient } = row\n const type = row.type as string\n const isIncoming = item.kind === 'incoming'\n const user = renderers.renderUser\n\n if (type === 'file_shared') {\n const entry = describeServerNotification(row)\n return (\n <div className=\"flex h-full items-center gap-2 text-sm\">\n <span>{entry?.title}</span>\n </div>\n )\n }\n\n // Workspace membership, from the recipient's or sender's perspective.\n if (isWorkspaceNotificationType(type)) {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>{getWorkspaceActionText(type)}</span>\n </PersonLine>\n )\n const { before, after } = getWorkspaceSentPhrase(type)\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>{before}</span>\n {user(recipient)}\n {after && <span className={PHRASE_CLASS}>{after}</span>}\n </div>\n )\n }\n\n if (type === 'contact_accepted') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'accepted your invitation to join the platform'}\n </span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={`${PHRASE_CLASS} italic`}>\n {row.content || 'Accepted an invitation to join the platform'}\n </span>\n </div>\n )\n }\n\n // A workspace access request: received, \"Review\" opens the grant flow.\n if (type === 'workspace_access_request') {\n if (isIncoming)\n return (\n <PersonLine person={user(sender)}>\n <span className={PHRASE_CLASS}>requested workspace access</span>\n </PersonLine>\n )\n return (\n <div className=\"flex items-center h-full gap-1.5 text-muted-foreground\">\n <span className={PHRASE_CLASS}>Requested workspace access from</span>\n {user(recipient)}\n </div>\n )\n }\n\n // A Box admin's notice: someone was invited or joined. Same sentence as the bell and toast,\n // with \"Manage users\" to the portal when the link is a trusted portal URL.\n if (isDeploymentUserNotification(type)) {\n const entry = describeServerNotification(row)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n data-testid=\"notification-deployment-user\"\n >\n <span className=\"min-w-0 truncate\" title={entry?.title}>\n {entry?.title}\n </span>\n </div>\n )\n }\n\n // Self-notifications: a refused Box seat, a signup bonus, a reward.\n const selfLine =\n type === BOX_SEAT_REFUSED\n ? BOX_SEAT_REFUSED_TITLE\n : type === 'signup_reward'\n ? `Signup bonus \u2014 ${row.content || 'You earned a signup bonus'}`\n : type === 'referral_reward'\n ? `Reward earned \u2014 ${row.content || 'You earned a reward'}`\n : null\n if (selfLine)\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n <span className=\"min-w-0 truncate\">{selfLine}</span>\n </div>\n )\n\n // An @mention: name the person and offer \"Open\" to jump to the message.\n if (type === 'mention' || type === 'docx_mention') {\n const inDocument = type === 'docx_mention'\n return (\n <div className=\"flex h-full items-center gap-1.5 text-muted-foreground\">\n {!isIncoming && <span className=\"text-sm\">You mentioned</span>}\n {isIncoming ? user(sender) : user(recipient)}\n <span className={PHRASE_CLASS}>\n {inDocument\n ? isIncoming\n ? 'mentioned you in a document comment'\n : 'in a document comment'\n : isIncoming\n ? 'mentioned you in a conversation'\n : 'in a conversation'}\n </span>\n </div>\n )\n }\n\n // A reply in a thread you take part in, or a new version of a document you own. Only\n // received: nobody is sent their own.\n if (type === 'thread_reply' || type === 'document_activity') {\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-muted-foreground\"\n data-testid=\"notification-relevance\"\n >\n {user(sender)}\n <span className={PHRASE_CLASS}>\n {type === 'thread_reply' ? 'replied in a thread' : documentActivityPhrase(row.content)}\n </span>\n </div>\n )\n }\n\n if (isSignatureNotificationType(type))\n return (\n <SignatureEvent\n row={row}\n isIncoming={isIncoming}\n open={open}\n renderers={renderers}\n action={action}\n />\n )\n\n // Work notifications \u2014 a task is a conversation, so the notification links straight to it.\n const workLabel =\n type === 'agent_input_requested'\n ? inputRequestTitle(row.content)\n : WORK_NOTIFICATION_LABELS[type]\n if (workLabel)\n return (\n <div\n className=\"flex h-full items-center gap-1.5 text-sm text-muted-foreground\"\n title={workLabel}\n data-testid=\"notification-work\"\n >\n <span className={`min-w-0 truncate ${type === 'workflow_failed' ? 'text-red-text' : ''}`}>\n {workLabel}\n </span>\n </div>\n )\n\n return (\n <div className=\"flex items-center h-full text-sm text-muted-foreground\">\n {(\n describeCalendarNotification(row, { senderName: notificationUserName(row.sender) }) ??\n describeServerNotification(row)\n )?.title ??\n row.content ??\n type ??\n 'Notification'}\n </div>\n )\n}\n\n/** A session-log entry: its message as toasted (+ its action while this session lasts). */\nfunction SessionEvent({\n item,\n open,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n}): ReactElement | null {\n const entry = item.entry\n if (!entry) return null\n return (\n <div\n className=\"flex h-full items-center gap-2 text-sm text-muted-foreground\"\n title={entry.title}\n >\n {entry.html ? (\n <span className=\"min-w-0 truncate\" dangerouslySetInnerHTML={{ __html: entry.html }} />\n ) : (\n <span className=\"min-w-0 truncate\">{entry.title}</span>\n )}\n {(entry.onSelect || entry.href) && (\n <ActionButton\n label={entry.actionLabel ?? 'Open'}\n onClick={() => {\n if (entry.onSelect) entry.onSelect()\n else if (entry.href) open({ kind: 'url', url: entry.href })\n }}\n />\n )}\n </div>\n )\n}\n\nexport function NotificationEvent({\n item,\n open,\n renderers,\n}: {\n item: NotificationCenterItem\n open: (target: NotificationTarget) => void\n renderers: NotificationCenterRenderers\n}): ReactElement | null {\n if (!item.persisted) return <SessionEvent item={item} open={open} />\n if (!item.row) return null\n const described =\n describeCalendarNotification(item.row, { senderName: notificationUserName(item.row.sender) }) ??\n describeServerNotification(item.row)\n const action = described?.target && (\n <ActionButton label={described.actionLabel ?? 'Open'} onClick={() => open(described.target!)} />\n )\n // A signature event is two lines: its action goes on the document's line, so the first keeps the\n // room to say who asked and what.\n const ownLine = isSignatureNotificationType(item.row.type as string)\n return (\n <div className=\"flex h-full min-w-0 items-center gap-2\">\n <div className=\"min-w-0 flex-1\">\n <PersistedEvent\n item={item}\n row={item.row}\n open={open}\n renderers={renderers}\n action={ownLine ? action : undefined}\n />\n </div>\n {!ownLine && action}\n </div>\n )\n}\n"],
|
|
5
5
|
"mappings": ";AAwDI,SA6CA,UA7CA,KAiBA,YAjBA;AAjDJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AAyBP,MAAM,eACJ;AACF,MAAM,eAAe;AAErB,SAAS,aAAa,EAAE,OAAO,QAAQ,GAA2C;AAChF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAK;AAAA,MACL,SAAS,CAAC,MAAM;AACd,UAAE,gBAAgB;AAClB,gBAAQ;AAAA,MACV;AAAA,MACA,WAAW;AAAA,MACX,eA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AAM,SAAS,WAAW,UACxB,oBAAC,gBAAa,OAAO,UAAU,eAAe,QAAQ,SAAS,MAAM,KAAK,UAAU,MAAO,GAAG;AAIhG,QAAM,UAAU,4BAA4B,KAAK,IAAI,IAAc;AACnE,SACE,qBAAC,SAAI,WAAU,0CACb;AAAA,wBAAC,SAAI,WAAU,kBACb;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA,KAAK,KAAK;AAAA,QACV;AAAA,QACA;AAAA,QACA,QAAQ,UAAU,SAAS;AAAA;AAAA,IAC7B,GACF;AAAA,IACC,CAAC,WAAW;AAAA,KACf;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -8,10 +8,10 @@ import type { ViewedDocument } from './useViewedDocument';
|
|
|
8
8
|
export declare function useViewerBlobs(documentId: string, doc: ViewedDocument): {
|
|
9
9
|
pdfBlob: NoInfer<Blob> | null;
|
|
10
10
|
pdfVerified: boolean;
|
|
11
|
-
retryPdf: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<Blob>,
|
|
11
|
+
retryPdf: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<NoInfer<Blob>, unknown>>;
|
|
12
12
|
isPdfLoading: boolean;
|
|
13
|
-
pdfError:
|
|
13
|
+
pdfError: unknown;
|
|
14
14
|
xlsxBlob: NoInfer<Blob> | null;
|
|
15
|
-
xlsxError:
|
|
15
|
+
xlsxError: unknown;
|
|
16
16
|
handleDirectDownload: () => Promise<void>;
|
|
17
17
|
};
|
|
@@ -28,7 +28,9 @@ function useViewerBlobs(documentId, doc) {
|
|
|
28
28
|
version: currentVersion,
|
|
29
29
|
kind: original ? "original" : "pdf",
|
|
30
30
|
enabled: (!isArtifact || isDocx && !doc.isDraft && !doc.isStreaming && !doc.liveKind) && !!documentData && !isDownloadOnly && (!isDocx || snapshot || documentData.status === "completed" || documentData.status === "low-content"),
|
|
31
|
-
fallback
|
|
31
|
+
fallback,
|
|
32
|
+
// A saved Word version's PDF is produced after the save: a 404 now is "not yet" (about 30 s).
|
|
33
|
+
retryMissing: isDocx ? 20 : 0
|
|
32
34
|
});
|
|
33
35
|
const pdfReady = !isDocx || snapshot || ["completed", "low-content"].includes(documentData?.status || "");
|
|
34
36
|
const pdfBlob = pdfReady && !pdf.isPlaceholderData ? pdf.data ?? null : null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/viewer/useViewerBlobs.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * The bytes the document viewer shows: the PDF (or, for media, the stored file), with the host's\n * copy kept on the device when the network is down; the stored sheet; the `.webm` track probe; and\n * downloading the stored file.\n */\n\nimport { useCallback, useEffect } from 'react'\nimport { hasVideoTrack, loadOfflineDocument } from '@arbidocs/react'\nimport { parseVersionRef } from '@arbidocs/react/artifacts'\nimport {\n fetchDocumentFile,\n useDocumentBytes,\n useDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport { isAudioFile, isImageFile, isVideoFile } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport type { ViewedDocument } from './useViewedDocument'\n\n// Offline copies predate version metadata; they are useful to read but not safe for signing.\nconst offlineCopies = new WeakSet<Blob>()\n\n/** `documentId` may be a version reference (`doc-\u2026@v2`). */\nexport function useViewerBlobs(documentId: string, doc: ViewedDocument) {\n const { documentData, isArtifact, isDocx, isXlsx, isDownloadOnly, isWebmFile } = doc\n const { setWebmHasVideoTrack } = doc\n const { client, saveFile } = useDocumentTools()\n const { notify } = useBlocksEnvironment()\n const currentVersion = documentData?.current_version ?? 1\n const snapshot = !!parseVersionRef(documentId).version\n\n // Images, video and audio show the stored file; everything else its PDF.\n const name = documentData?.file_name\n const original = isImageFile(name) || isVideoFile(name) || isAudioFile(name)\n // Offline records have no version identity; keep them readable but mark them unverified.\n const fallback =\n documentData && !snapshot\n ? async () => {\n const blob = await loadOfflineDocument(documentData.external_id)\n if (blob) offlineCopies.add(blob)\n return blob\n }\n : undefined\n const pdf = useDocumentBytes(documentId, {\n version: currentVersion,\n kind: original ? 'original' : 'pdf',\n enabled:\n (!isArtifact || (isDocx && !doc.isDraft && !doc.isStreaming && !doc.liveKind)) &&\n !!documentData &&\n !isDownloadOnly &&\n (!isDocx ||\n snapshot ||\n documentData.status === 'completed' ||\n documentData.status === 'low-content'),\n fallback,\n })\n // The query is keyed by version. Never keep an older PDF while the new version processes:\n // the viewer also offers signing actions against the displayed bytes.\n const pdfReady =\n !isDocx || snapshot || ['completed', 'low-content'].includes(documentData?.status || '')\n const pdfBlob = pdfReady && !pdf.isPlaceholderData ? (pdf.data ?? null) : null\n const pdfVerified = !!pdfBlob && !offlineCopies.has(pdfBlob)\n\n // Resolve the ambiguous .webm case once the bytes are here.\n useEffect(() => {\n if (!isWebmFile || !pdfBlob) return\n let cancelled = false\n void hasVideoTrack(pdfBlob).then((result) => {\n if (!cancelled) setWebmHasVideoTrack(result)\n })\n return () => {\n cancelled = true\n }\n }, [isWebmFile, pdfBlob, setWebmHasVideoTrack])\n\n // The stored sheet (all its sheets).\n const xlsx = useDocumentBytes(documentId, {\n version: currentVersion,\n kind: 'original',\n enabled: !isArtifact && !!documentData && isXlsx,\n })\n\n const handleDirectDownload = useCallback(async () => {\n try {\n saveFile(await fetchDocumentFile(client, documentId), documentData?.file_name || 'download')\n } catch {\n notify('Failed to download file', 'error')\n }\n }, [client, saveFile, notify, documentId, documentData?.file_name])\n\n return {\n pdfBlob,\n pdfVerified,\n retryPdf: pdf.refetch,\n isPdfLoading: pdf.isLoading,\n pdfError: pdf.error,\n xlsxBlob: xlsx.data ?? null,\n xlsxError: xlsx.error,\n handleDirectDownload,\n }\n}\n"],
|
|
5
|
-
"mappings": ";AAMA,SAAS,aAAa,iBAAiB;AACvC,SAAS,eAAe,2BAA2B;AACnD,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,aAAa,mBAAmB;AACtD,SAAS,4BAA4B;AAIrC,MAAM,gBAAgB,oBAAI,QAAc;AAGjC,SAAS,eAAe,YAAoB,KAAqB;AACtE,QAAM,EAAE,cAAc,YAAY,QAAQ,QAAQ,gBAAgB,WAAW,IAAI;AACjF,QAAM,EAAE,qBAAqB,IAAI;AACjC,QAAM,EAAE,QAAQ,SAAS,IAAI,iBAAiB;AAC9C,QAAM,EAAE,OAAO,IAAI,qBAAqB;AACxC,QAAM,iBAAiB,cAAc,mBAAmB;AACxD,QAAM,WAAW,CAAC,CAAC,gBAAgB,UAAU,EAAE;AAG/C,QAAM,OAAO,cAAc;AAC3B,QAAM,WAAW,YAAY,IAAI,KAAK,YAAY,IAAI,KAAK,YAAY,IAAI;AAE3E,QAAM,WACJ,gBAAgB,CAAC,WACb,YAAY;AACV,UAAM,OAAO,MAAM,oBAAoB,aAAa,WAAW;AAC/D,QAAI,KAAM,eAAc,IAAI,IAAI;AAChC,WAAO;AAAA,EACT,IACA;AACN,QAAM,MAAM,iBAAiB,YAAY;AAAA,IACvC,SAAS;AAAA,IACT,MAAM,WAAW,aAAa;AAAA,IAC9B,UACG,CAAC,cAAe,UAAU,CAAC,IAAI,WAAW,CAAC,IAAI,eAAe,CAAC,IAAI,aACpE,CAAC,CAAC,gBACF,CAAC,mBACA,CAAC,UACA,YACA,aAAa,WAAW,eACxB,aAAa,WAAW;AAAA,IAC5B;AAAA,
|
|
4
|
+
"sourcesContent": ["/**\n * The bytes the document viewer shows: the PDF (or, for media, the stored file), with the host's\n * copy kept on the device when the network is down; the stored sheet; the `.webm` track probe; and\n * downloading the stored file.\n */\n\nimport { useCallback, useEffect } from 'react'\nimport { hasVideoTrack, loadOfflineDocument } from '@arbidocs/react'\nimport { parseVersionRef } from '@arbidocs/react/artifacts'\nimport {\n fetchDocumentFile,\n useDocumentBytes,\n useDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport { isAudioFile, isImageFile, isVideoFile } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport type { ViewedDocument } from './useViewedDocument'\n\n// Offline copies predate version metadata; they are useful to read but not safe for signing.\nconst offlineCopies = new WeakSet<Blob>()\n\n/** `documentId` may be a version reference (`doc-\u2026@v2`). */\nexport function useViewerBlobs(documentId: string, doc: ViewedDocument) {\n const { documentData, isArtifact, isDocx, isXlsx, isDownloadOnly, isWebmFile } = doc\n const { setWebmHasVideoTrack } = doc\n const { client, saveFile } = useDocumentTools()\n const { notify } = useBlocksEnvironment()\n const currentVersion = documentData?.current_version ?? 1\n const snapshot = !!parseVersionRef(documentId).version\n\n // Images, video and audio show the stored file; everything else its PDF.\n const name = documentData?.file_name\n const original = isImageFile(name) || isVideoFile(name) || isAudioFile(name)\n // Offline records have no version identity; keep them readable but mark them unverified.\n const fallback =\n documentData && !snapshot\n ? async () => {\n const blob = await loadOfflineDocument(documentData.external_id)\n if (blob) offlineCopies.add(blob)\n return blob\n }\n : undefined\n const pdf = useDocumentBytes(documentId, {\n version: currentVersion,\n kind: original ? 'original' : 'pdf',\n enabled:\n (!isArtifact || (isDocx && !doc.isDraft && !doc.isStreaming && !doc.liveKind)) &&\n !!documentData &&\n !isDownloadOnly &&\n (!isDocx ||\n snapshot ||\n documentData.status === 'completed' ||\n documentData.status === 'low-content'),\n fallback,\n // A saved Word version's PDF is produced after the save: a 404 now is \"not yet\" (about 30 s).\n retryMissing: isDocx ? 20 : 0,\n })\n // The query is keyed by version. Never keep an older PDF while the new version processes:\n // the viewer also offers signing actions against the displayed bytes.\n const pdfReady =\n !isDocx || snapshot || ['completed', 'low-content'].includes(documentData?.status || '')\n const pdfBlob = pdfReady && !pdf.isPlaceholderData ? (pdf.data ?? null) : null\n const pdfVerified = !!pdfBlob && !offlineCopies.has(pdfBlob)\n\n // Resolve the ambiguous .webm case once the bytes are here.\n useEffect(() => {\n if (!isWebmFile || !pdfBlob) return\n let cancelled = false\n void hasVideoTrack(pdfBlob).then((result) => {\n if (!cancelled) setWebmHasVideoTrack(result)\n })\n return () => {\n cancelled = true\n }\n }, [isWebmFile, pdfBlob, setWebmHasVideoTrack])\n\n // The stored sheet (all its sheets).\n const xlsx = useDocumentBytes(documentId, {\n version: currentVersion,\n kind: 'original',\n enabled: !isArtifact && !!documentData && isXlsx,\n })\n\n const handleDirectDownload = useCallback(async () => {\n try {\n saveFile(await fetchDocumentFile(client, documentId), documentData?.file_name || 'download')\n } catch {\n notify('Failed to download file', 'error')\n }\n }, [client, saveFile, notify, documentId, documentData?.file_name])\n\n return {\n pdfBlob,\n pdfVerified,\n retryPdf: pdf.refetch,\n isPdfLoading: pdf.isLoading,\n pdfError: pdf.error,\n xlsxBlob: xlsx.data ?? null,\n xlsxError: xlsx.error,\n handleDirectDownload,\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAMA,SAAS,aAAa,iBAAiB;AACvC,SAAS,eAAe,2BAA2B;AACnD,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,aAAa,aAAa,mBAAmB;AACtD,SAAS,4BAA4B;AAIrC,MAAM,gBAAgB,oBAAI,QAAc;AAGjC,SAAS,eAAe,YAAoB,KAAqB;AACtE,QAAM,EAAE,cAAc,YAAY,QAAQ,QAAQ,gBAAgB,WAAW,IAAI;AACjF,QAAM,EAAE,qBAAqB,IAAI;AACjC,QAAM,EAAE,QAAQ,SAAS,IAAI,iBAAiB;AAC9C,QAAM,EAAE,OAAO,IAAI,qBAAqB;AACxC,QAAM,iBAAiB,cAAc,mBAAmB;AACxD,QAAM,WAAW,CAAC,CAAC,gBAAgB,UAAU,EAAE;AAG/C,QAAM,OAAO,cAAc;AAC3B,QAAM,WAAW,YAAY,IAAI,KAAK,YAAY,IAAI,KAAK,YAAY,IAAI;AAE3E,QAAM,WACJ,gBAAgB,CAAC,WACb,YAAY;AACV,UAAM,OAAO,MAAM,oBAAoB,aAAa,WAAW;AAC/D,QAA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A,IACL;AAAA,IACA;AAAA,IACA,UAAU,IAAI;AAAA,IACd,cAAc,IAAI;AAAA,IAClB,UAAU,IAAI;AAAA,IACd,UAAU,KAAK,QAAQ;AAAA,IACvB,WAAW,KAAK;AAAA,IAChB;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -10,8 +10,8 @@ require('../chunk-ZU2B2RZK.cjs');
|
|
|
10
10
|
var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
|
|
11
11
|
var chunkOEJQFPWO_cjs = require('../chunk-OEJQFPWO.cjs');
|
|
12
12
|
require('../chunk-OUGRCQM7.cjs');
|
|
13
|
-
require('../chunk-IPSHAMO2.cjs');
|
|
14
13
|
var chunkZW6FPIFC_cjs = require('../chunk-ZW6FPIFC.cjs');
|
|
14
|
+
require('../chunk-IPSHAMO2.cjs');
|
|
15
15
|
var chunkLIKDQBNJ_cjs = require('../chunk-LIKDQBNJ.cjs');
|
|
16
16
|
require('../chunk-YZBDHBKI.cjs');
|
|
17
17
|
require('../chunk-CVPV4I7Z.cjs');
|
package/dist/docx/index.cjs
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
4
|
var chunk2BOTSU23_cjs = require('../chunk-2BOTSU23.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var chunkO6OLY43S_cjs = require('../chunk-O6OLY43S.cjs');
|
|
6
|
+
var chunkINNHU46B_cjs = require('../chunk-INNHU46B.cjs');
|
|
7
|
+
var chunk6JLRF7N6_cjs = require('../chunk-6JLRF7N6.cjs');
|
|
8
8
|
var chunkGA5ZO4YA_cjs = require('../chunk-GA5ZO4YA.cjs');
|
|
9
9
|
var chunkVG5XNE4H_cjs = require('../chunk-VG5XNE4H.cjs');
|
|
10
10
|
require('../chunk-DDWLMYRO.cjs');
|
|
@@ -27,143 +27,143 @@ Object.defineProperty(exports, "loadDocxFonts", {
|
|
|
27
27
|
});
|
|
28
28
|
Object.defineProperty(exports, "StreamedWordArtifact", {
|
|
29
29
|
enumerable: true,
|
|
30
|
-
get: function () { return
|
|
30
|
+
get: function () { return chunkO6OLY43S_cjs.StreamedWordArtifact; }
|
|
31
31
|
});
|
|
32
32
|
Object.defineProperty(exports, "NativeDocxComparison", {
|
|
33
33
|
enumerable: true,
|
|
34
|
-
get: function () { return
|
|
34
|
+
get: function () { return chunkINNHU46B_cjs.NativeDocxComparison; }
|
|
35
35
|
});
|
|
36
36
|
Object.defineProperty(exports, "CrossReferencesProvider", {
|
|
37
37
|
enumerable: true,
|
|
38
|
-
get: function () { return
|
|
38
|
+
get: function () { return chunk6JLRF7N6_cjs.CrossReferencesProvider; }
|
|
39
39
|
});
|
|
40
40
|
Object.defineProperty(exports, "DEFAULT_CROSS_REFERENCES_LABELS", {
|
|
41
41
|
enumerable: true,
|
|
42
|
-
get: function () { return
|
|
42
|
+
get: function () { return chunk6JLRF7N6_cjs.DEFAULT_CROSS_REFERENCES_LABELS; }
|
|
43
43
|
});
|
|
44
44
|
Object.defineProperty(exports, "DEFAULT_DEFINED_TERMS_LABELS", {
|
|
45
45
|
enumerable: true,
|
|
46
|
-
get: function () { return
|
|
46
|
+
get: function () { return chunk6JLRF7N6_cjs.DEFAULT_DEFINED_TERMS_LABELS; }
|
|
47
47
|
});
|
|
48
48
|
Object.defineProperty(exports, "DEFINED_TERM_TRIGGER", {
|
|
49
49
|
enumerable: true,
|
|
50
|
-
get: function () { return
|
|
50
|
+
get: function () { return chunk6JLRF7N6_cjs.DEFINED_TERM_TRIGGER; }
|
|
51
51
|
});
|
|
52
52
|
Object.defineProperty(exports, "DefinedTermsProvider", {
|
|
53
53
|
enumerable: true,
|
|
54
|
-
get: function () { return
|
|
54
|
+
get: function () { return chunk6JLRF7N6_cjs.DefinedTermsProvider; }
|
|
55
55
|
});
|
|
56
56
|
Object.defineProperty(exports, "DocxCommentActivity", {
|
|
57
57
|
enumerable: true,
|
|
58
|
-
get: function () { return
|
|
58
|
+
get: function () { return chunk6JLRF7N6_cjs.DocxCommentActivity; }
|
|
59
59
|
});
|
|
60
60
|
Object.defineProperty(exports, "DocxEditorReview", {
|
|
61
61
|
enumerable: true,
|
|
62
|
-
get: function () { return
|
|
62
|
+
get: function () { return chunk6JLRF7N6_cjs.DocxEditorReview; }
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, "DocxMentions", {
|
|
65
65
|
enumerable: true,
|
|
66
|
-
get: function () { return
|
|
66
|
+
get: function () { return chunk6JLRF7N6_cjs.DocxMentions; }
|
|
67
67
|
});
|
|
68
68
|
Object.defineProperty(exports, "DocxParticipants", {
|
|
69
69
|
enumerable: true,
|
|
70
|
-
get: function () { return
|
|
70
|
+
get: function () { return chunk6JLRF7N6_cjs.DocxParticipants; }
|
|
71
71
|
});
|
|
72
72
|
Object.defineProperty(exports, "DocxRibbon", {
|
|
73
73
|
enumerable: true,
|
|
74
|
-
get: function () { return
|
|
74
|
+
get: function () { return chunk6JLRF7N6_cjs.DocxRibbon; }
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, "GenerateImageButton", {
|
|
77
77
|
enumerable: true,
|
|
78
|
-
get: function () { return
|
|
78
|
+
get: function () { return chunk6JLRF7N6_cjs.GenerateImageButton; }
|
|
79
79
|
});
|
|
80
80
|
Object.defineProperty(exports, "LinkHoverCard", {
|
|
81
81
|
enumerable: true,
|
|
82
|
-
get: function () { return
|
|
82
|
+
get: function () { return chunk6JLRF7N6_cjs.LinkHoverCard; }
|
|
83
83
|
});
|
|
84
84
|
Object.defineProperty(exports, "NativeDocxEditor", {
|
|
85
85
|
enumerable: true,
|
|
86
|
-
get: function () { return
|
|
86
|
+
get: function () { return chunk6JLRF7N6_cjs.NativeDocxEditor; }
|
|
87
87
|
});
|
|
88
88
|
Object.defineProperty(exports, "SignatureFieldMenu", {
|
|
89
89
|
enumerable: true,
|
|
90
|
-
get: function () { return
|
|
90
|
+
get: function () { return chunk6JLRF7N6_cjs.SignatureFieldMenu; }
|
|
91
91
|
});
|
|
92
92
|
Object.defineProperty(exports, "SignatureFieldsProvider", {
|
|
93
93
|
enumerable: true,
|
|
94
|
-
get: function () { return
|
|
94
|
+
get: function () { return chunk6JLRF7N6_cjs.SignatureFieldsProvider; }
|
|
95
95
|
});
|
|
96
96
|
Object.defineProperty(exports, "editorPort", {
|
|
97
97
|
enumerable: true,
|
|
98
|
-
get: function () { return
|
|
98
|
+
get: function () { return chunk6JLRF7N6_cjs.editorPort; }
|
|
99
99
|
});
|
|
100
100
|
Object.defineProperty(exports, "findDefinitionsSection", {
|
|
101
101
|
enumerable: true,
|
|
102
|
-
get: function () { return
|
|
102
|
+
get: function () { return chunk6JLRF7N6_cjs.findDefinitionsSection; }
|
|
103
103
|
});
|
|
104
104
|
Object.defineProperty(exports, "insertCrossReference", {
|
|
105
105
|
enumerable: true,
|
|
106
|
-
get: function () { return
|
|
106
|
+
get: function () { return chunk6JLRF7N6_cjs.insertCrossReference; }
|
|
107
107
|
});
|
|
108
108
|
Object.defineProperty(exports, "insertDefinedTerm", {
|
|
109
109
|
enumerable: true,
|
|
110
|
-
get: function () { return
|
|
110
|
+
get: function () { return chunk6JLRF7N6_cjs.insertDefinedTerm; }
|
|
111
111
|
});
|
|
112
112
|
Object.defineProperty(exports, "insertDocumentReference", {
|
|
113
113
|
enumerable: true,
|
|
114
|
-
get: function () { return
|
|
114
|
+
get: function () { return chunk6JLRF7N6_cjs.insertDocumentReference; }
|
|
115
115
|
});
|
|
116
116
|
Object.defineProperty(exports, "insertSignatureField", {
|
|
117
117
|
enumerable: true,
|
|
118
|
-
get: function () { return
|
|
118
|
+
get: function () { return chunk6JLRF7N6_cjs.insertSignatureField; }
|
|
119
119
|
});
|
|
120
120
|
Object.defineProperty(exports, "listTargets", {
|
|
121
121
|
enumerable: true,
|
|
122
|
-
get: function () { return
|
|
122
|
+
get: function () { return chunk6JLRF7N6_cjs.listTargets; }
|
|
123
123
|
});
|
|
124
124
|
Object.defineProperty(exports, "normalizeDocxExport", {
|
|
125
125
|
enumerable: true,
|
|
126
|
-
get: function () { return
|
|
126
|
+
get: function () { return chunk6JLRF7N6_cjs.normalizeDocxExport; }
|
|
127
127
|
});
|
|
128
128
|
Object.defineProperty(exports, "paragraphNumber", {
|
|
129
129
|
enumerable: true,
|
|
130
|
-
get: function () { return
|
|
130
|
+
get: function () { return chunk6JLRF7N6_cjs.paragraphNumber; }
|
|
131
131
|
});
|
|
132
132
|
Object.defineProperty(exports, "referenceText", {
|
|
133
133
|
enumerable: true,
|
|
134
|
-
get: function () { return
|
|
134
|
+
get: function () { return chunk6JLRF7N6_cjs.referenceText; }
|
|
135
135
|
});
|
|
136
136
|
Object.defineProperty(exports, "referencesPort", {
|
|
137
137
|
enumerable: true,
|
|
138
|
-
get: function () { return
|
|
138
|
+
get: function () { return chunk6JLRF7N6_cjs.referencesPort; }
|
|
139
139
|
});
|
|
140
140
|
Object.defineProperty(exports, "reviewModule", {
|
|
141
141
|
enumerable: true,
|
|
142
|
-
get: function () { return
|
|
142
|
+
get: function () { return chunk6JLRF7N6_cjs.reviewModule; }
|
|
143
143
|
});
|
|
144
144
|
Object.defineProperty(exports, "shortTitle", {
|
|
145
145
|
enumerable: true,
|
|
146
|
-
get: function () { return
|
|
146
|
+
get: function () { return chunk6JLRF7N6_cjs.shortTitle; }
|
|
147
147
|
});
|
|
148
148
|
Object.defineProperty(exports, "useCrossReferences", {
|
|
149
149
|
enumerable: true,
|
|
150
|
-
get: function () { return
|
|
150
|
+
get: function () { return chunk6JLRF7N6_cjs.useCrossReferences; }
|
|
151
151
|
});
|
|
152
152
|
Object.defineProperty(exports, "useDefinedTerms", {
|
|
153
153
|
enumerable: true,
|
|
154
|
-
get: function () { return
|
|
154
|
+
get: function () { return chunk6JLRF7N6_cjs.useDefinedTerms; }
|
|
155
155
|
});
|
|
156
156
|
Object.defineProperty(exports, "useReview", {
|
|
157
157
|
enumerable: true,
|
|
158
|
-
get: function () { return
|
|
158
|
+
get: function () { return chunk6JLRF7N6_cjs.useReview; }
|
|
159
159
|
});
|
|
160
160
|
Object.defineProperty(exports, "useReviewItem", {
|
|
161
161
|
enumerable: true,
|
|
162
|
-
get: function () { return
|
|
162
|
+
get: function () { return chunk6JLRF7N6_cjs.useReviewItem; }
|
|
163
163
|
});
|
|
164
164
|
Object.defineProperty(exports, "withDirectEditing", {
|
|
165
165
|
enumerable: true,
|
|
166
|
-
get: function () { return
|
|
166
|
+
get: function () { return chunk6JLRF7N6_cjs.withDirectEditing; }
|
|
167
167
|
});
|
|
168
168
|
Object.defineProperty(exports, "DocxAuthorContext", {
|
|
169
169
|
enumerable: true,
|
|
@@ -449,7 +449,8 @@ function DocxEditorReviewRail({
|
|
|
449
449
|
};
|
|
450
450
|
const escape = (event) => {
|
|
451
451
|
if (event.key !== "Escape" || event.defaultPrevented) return;
|
|
452
|
-
|
|
452
|
+
const lost = event.target === document.body || event.target === document.documentElement;
|
|
453
|
+
if (!lost && (!(event.target instanceof Node) || !element.contains(event.target))) return;
|
|
453
454
|
event.preventDefault();
|
|
454
455
|
dismiss();
|
|
455
456
|
};
|