@opengeni/react 6.35.1-canary.45051251770001 → 6.36.0
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/app/app-state.js +32 -32
- package/dist/app/components/Composer.js +43 -43
- package/dist/app/components/add-card-dialog.js +1 -1
- package/dist/app/components/add-card.js +2 -2
- package/dist/app/components/agent/agent-capability-picker.js +9 -9
- package/dist/app/components/agents/agent-can-use.js +47 -47
- package/dist/app/components/agents/agent-form-page.js +139 -139
- package/dist/app/components/agents/agent-page.js +122 -122
- package/dist/app/components/agents/agent-setup-sections.js +74 -74
- package/dist/app/components/agents/agent-skills.js +13 -13
- package/dist/app/components/agents/agent-trigger-chat-field.js +6 -6
- package/dist/app/components/agents/agent-trigger-dialog.js +31 -31
- package/dist/app/components/agents/agent-trigger-picker.js +8 -8
- package/dist/app/components/agents/agents-page.js +87 -87
- package/dist/app/components/agents/composer-agent-chip.js +59 -59
- package/dist/app/components/agents/session-agent-chip.js +55 -55
- package/dist/app/components/artifacts/app-package.js +11 -11
- package/dist/app/components/artifacts/artifact-browse-controls.js +3 -3
- package/dist/app/components/artifacts/artifact-library.js +28 -28
- package/dist/app/components/artifacts/artifact-page-chrome.js +1 -1
- package/dist/app/components/artifacts/artifact-viewer.js +65 -65
- package/dist/app/components/artifacts/chat-interactive-block.js +27 -27
- package/dist/app/components/artifacts/copy-artifact-link.js +1 -1
- package/dist/app/components/artifacts/file-reach-dialog.js +12 -12
- package/dist/app/components/artifacts/inline-chat-image.js +52 -52
- package/dist/app/components/artifacts/retained-file-preview.js +58 -58
- package/dist/app/components/artifacts/retained-text-preview.js +8 -8
- package/dist/app/components/artifacts/site-actions.js +12 -12
- package/dist/app/components/artifacts/site-audience.js +7 -7
- package/dist/app/components/artifacts/site-conversations.js +34 -34
- package/dist/app/components/artifacts/site-data.js +26 -26
- package/dist/app/components/artifacts/site-public-link.js +3 -3
- package/dist/app/components/artifacts/site-publishing-page.js +69 -69
- package/dist/app/components/artifacts/site-publishing.js +54 -54
- package/dist/app/components/artifacts/site-settings.js +68 -68
- package/dist/app/components/artifacts/site-version-menu.js +9 -9
- package/dist/app/components/billing-class-mark.js +8 -8
- package/dist/app/components/capabilities/capability-detail-sheet.js +16 -16
- package/dist/app/components/capabilities/capability-logo-source.js +28 -28
- package/dist/app/components/capabilities/capability-logo.js +1 -1
- package/dist/app/components/capabilities/connection-account-picker.js +2 -2
- package/dist/app/components/capabilities/connector-tool-permissions.js +8 -8
- package/dist/app/components/capabilities/native-connect-setup.js +32 -32
- package/dist/app/components/capabilities/own-logins-shared-heads-up.js +6 -6
- package/dist/app/components/capabilities/perform-capability-action.js +4 -4
- package/dist/app/components/capabilities/prepared-mcp-setup-card.js +31 -31
- package/dist/app/components/capabilities/session-capability-card.js +146 -146
- package/dist/app/components/capabilities/session-chrome-card.js +49 -49
- package/dist/app/components/capabilities/session-connect-inputs-card.js +33 -33
- package/dist/app/components/capabilities/session-custom-mcp-card.js +38 -38
- package/dist/app/components/capabilities/session-github-card.js +44 -44
- package/dist/app/components/capabilities/session-machine-card.js +50 -50
- package/dist/app/components/capabilities/session-personal-github-card.js +32 -32
- package/dist/app/components/capabilities/session-plugin-card.js +21 -21
- package/dist/app/components/capabilities/use-capabilities-catalog.js +1 -1
- package/dist/app/components/capabilities/use-connection-accounts.js +3 -3
- package/dist/app/components/chat-payment-pages.js +2 -2
- package/dist/app/components/command-menu/chat-status.js +26 -26
- package/dist/app/components/command-menu/chat-switcher.js +86 -86
- package/dist/app/components/command-menu/command-menu.js +109 -109
- package/dist/app/components/command-menu/shortcut-sheet.js +23 -23
- package/dist/app/components/composer-capabilities-menu-body.js +7 -7
- package/dist/app/components/composer-mobile-plus-panel.js +29 -29
- package/dist/app/components/composer-mobile-plus.js +3 -3
- package/dist/app/components/credit-required-gate.js +6 -6
- package/dist/app/components/credit-required-prompt.js +24 -24
- package/dist/app/components/credits/checkout-credits-celebration.js +1 -1
- package/dist/app/components/credits/checkout-return.js +1 -1
- package/dist/app/components/credits/coupon-redeem.js +1 -1
- package/dist/app/components/credits/credit-refusal-notice.js +8 -8
- package/dist/app/components/credits/own-subscription-plan-notice.js +3 -3
- package/dist/app/components/desktop/app-shots.js +9 -9
- package/dist/app/components/desktop/app-update.js +3 -3
- package/dist/app/components/desktop/computer-use.js +3 -3
- package/dist/app/components/desktop/this-computer.js +6 -6
- package/dist/app/components/feedback.js +10 -10
- package/dist/app/components/follow-up-repository-menu-body.js +14 -14
- package/dist/app/components/follow-up-repository-picker.js +1 -1
- package/dist/app/components/github-app-connect-launcher.js +2 -2
- package/dist/app/components/in-app-help-link.js +3 -3
- package/dist/app/components/knowledge/agent-learning-settings.js +3 -3
- package/dist/app/components/machines/connect-machine-dialog.js +25 -25
- package/dist/app/components/manual-repository-editor.js +3 -3
- package/dist/app/components/markdown.js +16 -16
- package/dist/app/components/model-identity.js +3 -3
- package/dist/app/components/models/models-ui.js +17 -17
- package/dist/app/components/models/provider-mark.js +3 -3
- package/dist/app/components/models/subscription-usage.js +5 -5
- package/dist/app/components/my-things.js +15 -15
- package/dist/app/components/own-where-it-works.js +10 -10
- package/dist/app/components/personal-resource-attachment-surface.js +4 -4
- package/dist/app/components/pickers.js +12 -12
- package/dist/app/components/rail/channel-create-dialog.js +6 -6
- package/dist/app/components/rail/project-glyph.js +52 -52
- package/dist/app/components/rail/project-profile.js +73 -73
- package/dist/app/components/rail/rail-context.js +2 -2
- package/dist/app/components/rail/rail-sections.js +155 -155
- package/dist/app/components/rail/session-header.js +124 -124
- package/dist/app/components/rail/session-list.js +154 -154
- package/dist/app/components/rail/session-row-content.js +7 -7
- package/dist/app/components/rail/session-row-hover-details.js +37 -37
- package/dist/app/components/rail/session-shell.js +192 -192
- package/dist/app/components/rail/site-session-group-heading.js +36 -36
- package/dist/app/components/repository-picker.js +14 -14
- package/dist/app/components/secrets/session-secrets-panel.js +4 -4
- package/dist/app/components/session/agent-configuration-panel.js +48 -48
- package/dist/app/components/session/artifact-session-page.js +7 -7
- package/dist/app/components/session/banners.js +20 -20
- package/dist/app/components/session/chat-avatar.js +52 -52
- package/dist/app/components/session/console-new-conversation.js +111 -111
- package/dist/app/components/session/descendant-requests.js +109 -109
- package/dist/app/components/session/editable-artifacts-workspace.js +59 -59
- package/dist/app/components/session/failed-session-banner.js +30 -30
- package/dist/app/components/session/failure-recovery-boundary.js +3 -3
- package/dist/app/components/session/human-input-delegation-record.js +3 -3
- package/dist/app/components/session/human-input.js +86 -86
- package/dist/app/components/session/inspector.js +142 -142
- package/dist/app/components/session/linked-panel.js +3 -3
- package/dist/app/components/session/message-actions.js +10 -10
- package/dist/app/components/session/model-recovery-notice.js +4 -4
- package/dist/app/components/session/new-session-settings-menu.js +28 -28
- package/dist/app/components/session/new-session-setup-strip.js +55 -55
- package/dist/app/components/session/pull-request-panel.js +25 -25
- package/dist/app/components/session/sandbox-recovery-actions.js +3 -3
- package/dist/app/components/session/sandbox-switcher.js +22 -22
- package/dist/app/components/session/sandbox-workspace.js +118 -118
- package/dist/app/components/session/search-markdown-highlight.js +17 -17
- package/dist/app/components/session/search-results-view.js +18 -18
- package/dist/app/components/session/session-admin-access.js +13 -13
- package/dist/app/components/session/session-admission-notice.js +11 -11
- package/dist/app/components/session/session-avatar-picker.js +59 -59
- package/dist/app/components/session/session-avatar.js +54 -54
- package/dist/app/components/session/session-machine-access-notice.js +11 -11
- package/dist/app/components/session/session-profile-dialog.js +70 -70
- package/dist/app/components/session/session-profile-editor.js +71 -71
- package/dist/app/components/session/session-retention.js +6 -6
- package/dist/app/components/session/session-search-dialog.js +20 -20
- package/dist/app/components/session/session-skill-reviews.js +5 -5
- package/dist/app/components/session/session-tenancy-control.js +26 -26
- package/dist/app/components/session/session-unattended-setting.js +1 -1
- package/dist/app/components/session/session-usage-limit-section.js +11 -11
- package/dist/app/components/session/share-chat-dialog.js +10 -10
- package/dist/app/components/session/subagents.js +23 -23
- package/dist/app/components/session/subscription-account-indicator.js +25 -25
- package/dist/app/components/session/subscription-account-menu.js +7 -7
- package/dist/app/components/session-connectors-menu-body.js +10 -10
- package/dist/app/components/settings/row-select.js +6 -6
- package/dist/app/components/toaster.js +2 -2
- package/dist/app/components/transcription-settings.js +10 -10
- package/dist/app/components/ui/destructive-confirm.js +10 -10
- package/dist/app/components/usage/usage-entry.js +8 -8
- package/dist/app/components/window-bar.js +24 -24
- package/dist/app/components/workspace-composer-plus.js +43 -43
- package/dist/app/components/workspace-reach.js +6 -6
- package/dist/app/embed/session-app.js +398 -398
- package/dist/app/lib/actions/actions-provider.js +18 -18
- package/dist/app/lib/agent-capabilities.js +4 -4
- package/dist/app/lib/app-connect-card.js +14 -14
- package/dist/app/lib/app-shared-key-dialog.js +8 -8
- package/dist/app/lib/app-surfaces.js +1 -1
- package/dist/app/lib/app-sync-opt-in.js +4 -4
- package/dist/app/lib/codex-usage-query.js +3 -3
- package/dist/app/lib/composer-agent.js +2 -2
- package/dist/app/lib/composer-connectors.js +32 -32
- package/dist/app/lib/composer-send-blocking.js +3 -3
- package/dist/app/lib/console-site.js +6 -6
- package/dist/app/lib/console-text.js +2 -2
- package/dist/app/lib/deployment-free-model.js +2 -2
- package/dist/app/lib/events.js +29 -29
- package/dist/app/lib/failed-session-copy.js +6 -6
- package/dist/app/lib/feedback-capture.js +2 -2
- package/dist/app/lib/free-credit-gap.js +2 -2
- package/dist/app/lib/model-access-onboarding.js +5 -5
- package/dist/app/lib/model-policy.js +1 -1
- package/dist/app/lib/move-chat-to-machine.js +5 -5
- package/dist/app/lib/personal-resource-attachments.js +1 -1
- package/dist/app/lib/session-branch-cache.js +19 -19
- package/dist/app/lib/session-create.js +5 -5
- package/dist/app/lib/session-group-pagination.js +19 -19
- package/dist/app/lib/session-hover-facts.js +26 -26
- package/dist/app/lib/session-list-dirty-scopes.js +20 -20
- package/dist/app/lib/session-model.js +3 -3
- package/dist/app/lib/session-rail.js +16 -16
- package/dist/app/lib/session-rename.js +4 -4
- package/dist/app/lib/sessions-group.js +23 -23
- package/dist/app/lib/site-tool-consent-dialog.js +23 -23
- package/dist/app/lib/site-tool-consent.js +1 -1
- package/dist/app/lib/turn-failure-analytics.js +8 -8
- package/dist/app/lib/unavailable-session-model.js +2 -2
- package/dist/app/lib/use-artifact-catalog.js +2 -2
- package/dist/app/lib/use-duplicate-site.js +4 -4
- package/dist/app/lib/use-follow-up-repositories.js +5 -5
- package/dist/app/lib/use-personal-resource-attachment.js +2 -2
- package/dist/app/lib/use-workspace-machines.js +9 -9
- package/dist/app/lib/use-workspace-model-catalog.js +7 -7
- package/dist/app/lib/use-workspace-rigs.js +6 -6
- package/dist/app/lib/workspace-navigation-preference.js +5 -5
- package/dist/app/lib/workspace-scope-context.js +4 -4
- package/dist/app/routes/app-page-view.js +17 -17
- package/dist/app/routes/app-page.js +2 -2
- package/dist/app/routes/artifacts.js +152 -152
- package/dist/app/routes/retained-artifact.js +108 -108
- package/dist/app/routes/session-unavailable.js +5 -5
- package/dist/app/routes/session.js +249 -249
- package/dist/app/routes/sessions-index-hydration.js +6 -6
- package/dist/app/routes/sessions-index.js +207 -207
- package/dist/app/routes/site-view.js +200 -200
- package/dist/artifacts-document.js +4 -4
- package/dist/artifacts-presentation.js +7 -7
- package/dist/artifacts-spreadsheet.js +4 -4
- package/dist/artifacts.js +50 -50
- package/dist/automation-model.js +7 -7
- package/dist/automations.js +65 -65
- package/dist/browser-viewer-EIEMRVFF.js +23 -0
- package/dist/chat-interactive-block-FV37LWYZ.js +22 -0
- package/dist/chunk-2COBAJC7.js +818 -0
- package/dist/chunk-2HS3IUXE.js +170 -0
- package/dist/chunk-2JTMFYCT.js +296 -0
- package/dist/chunk-2JXKP4M6.js +114 -0
- package/dist/chunk-2P5K7CBH.js +269 -0
- package/dist/chunk-2XGRHMRI.js +250 -0
- package/dist/chunk-332BYSAZ.js +65 -0
- package/dist/chunk-3EM5GTP3.js +158 -0
- package/dist/chunk-3L5ATO4A.js +52 -0
- package/dist/chunk-3S3PJB7J.js +107 -0
- package/dist/chunk-3SBKYPNM.js +270 -0
- package/dist/chunk-3Z7VA6ET.js +114 -0
- package/dist/chunk-43BRJBEV.js +207 -0
- package/dist/chunk-46LZO4ZO.js +188 -0
- package/dist/chunk-46ZC5VNC.js +38 -0
- package/dist/chunk-4AH4EEHE.js +298 -0
- package/dist/chunk-4D3YJNVN.js +270 -0
- package/dist/chunk-4E5QVAT4.js +4480 -0
- package/dist/chunk-4E5QVAT4.js.map +1 -0
- package/dist/chunk-4I4RTI4D.js +37 -0
- package/dist/chunk-4KASGJTF.js +287 -0
- package/dist/chunk-4RUKLIOF.js +1263 -0
- package/dist/chunk-4UU7FN3I.js +650 -0
- package/dist/chunk-4VEIBNC2.js +427 -0
- package/dist/chunk-4VEIBNC2.js.map +1 -0
- package/dist/chunk-4ZRNASBF.js +2551 -0
- package/dist/chunk-5EJBPQI2.js +41 -0
- package/dist/chunk-5G4IGG7F.js +209 -0
- package/dist/chunk-5JAYZOAW.js +131 -0
- package/dist/chunk-5JOKVDSR.js +789 -0
- package/dist/chunk-5MP3G7ZV.js +1236 -0
- package/dist/chunk-5OVRMKP5.js +42 -0
- package/dist/chunk-5SGTRULO.js +1184 -0
- package/dist/chunk-5SOL4INY.js +572 -0
- package/dist/chunk-5Y34P32B.js +27 -0
- package/dist/chunk-62HIKJ5F.js +72 -0
- package/dist/chunk-62T2ZPD5.js +266 -0
- package/dist/chunk-63VNZRLY.js +386 -0
- package/dist/chunk-6CDBX3XG.js +33 -0
- package/dist/chunk-6D3D2JWY.js +278 -0
- package/dist/chunk-6DOIINY4.js +201 -0
- package/dist/chunk-6DQBUKGJ.js +112 -0
- package/dist/chunk-6SETNFNH.js +1399 -0
- package/dist/chunk-6XYFMHNT.js +56 -0
- package/dist/chunk-6YU3WV2P.js +33 -0
- package/dist/chunk-6YUHDFOZ.js +351 -0
- package/dist/chunk-72EOXOR7.js +1185 -0
- package/dist/chunk-72ND4ALI.js +532 -0
- package/dist/chunk-757LE32E.js +283 -0
- package/dist/chunk-7S2S4MXR.js +138 -0
- package/dist/chunk-7SYCHMXS.js +200 -0
- package/dist/chunk-7TVAPQOV.js +5089 -0
- package/dist/chunk-7UDLRDHK.js +214 -0
- package/dist/chunk-7YLQCMZP.js +357 -0
- package/dist/chunk-A5GX3CAE.js +849 -0
- package/dist/chunk-A7EBV2EB.js +318 -0
- package/dist/chunk-AB5SPXUR.js +114 -0
- package/dist/chunk-AHVQGL5A.js +202 -0
- package/dist/chunk-AI77ZKEV.js +26 -0
- package/dist/chunk-AIX2D6RB.js +1019 -0
- package/dist/chunk-AVSIHP7Q.js +192 -0
- package/dist/chunk-AWK23Q32.js +107 -0
- package/dist/chunk-AYVWA6KD.js +432 -0
- package/dist/chunk-AYZXE4IM.js +2553 -0
- package/dist/chunk-AZGGSPTE.js +124 -0
- package/dist/chunk-B45TB4HY.js +931 -0
- package/dist/chunk-BIUJHNVR.js +46 -0
- package/dist/chunk-BJUOKUE5.js +234 -0
- package/dist/chunk-BPEEVMKH.js +292 -0
- package/dist/chunk-BPHPAGYF.js +74 -0
- package/dist/chunk-BXMND6YU.js +307 -0
- package/dist/chunk-C6OM2SRG.js +117 -0
- package/dist/chunk-CIRCUDKF.js +1309 -0
- package/dist/chunk-CLKR4UG3.js +403 -0
- package/dist/chunk-CPX6BHER.js +554 -0
- package/dist/chunk-CVC4RO7D.js +155 -0
- package/dist/chunk-D3YJAQGK.js +103 -0
- package/dist/chunk-DFQ72BLS.js +1024 -0
- package/dist/chunk-DG65PJOZ.js +4564 -0
- package/dist/chunk-DNAXAS5R.js +406 -0
- package/dist/chunk-DO247ITS.js +175 -0
- package/dist/chunk-DONBARLL.js +154 -0
- package/dist/chunk-DTLXQ3ZU.js +373 -0
- package/dist/chunk-EAXTACI4.js +274 -0
- package/dist/chunk-EDPH7AJH.js +412 -0
- package/dist/chunk-EER3B3G5.js +10036 -0
- package/dist/chunk-EER3B3G5.js.map +1 -0
- package/dist/chunk-EFKQHCGJ.js +276 -0
- package/dist/chunk-EILSPMVD.js +133 -0
- package/dist/chunk-EK7KIETS.js +211 -0
- package/dist/chunk-EMWT6GOK.js +437 -0
- package/dist/chunk-EO22NST7.js +259 -0
- package/dist/chunk-ER5MYLIE.js +256 -0
- package/dist/chunk-ES5HKVQF.js +234 -0
- package/dist/chunk-EXRQ5ATC.js +738 -0
- package/dist/chunk-EXRQ5ATC.js.map +1 -0
- package/dist/chunk-F26YBYAZ.js +111 -0
- package/dist/chunk-F6QP4GSK.js +515 -0
- package/dist/chunk-F7QEO7M2.js +851 -0
- package/dist/chunk-FJFGDLXB.js +12 -0
- package/dist/chunk-FLLJ2WXW.js +113 -0
- package/dist/chunk-FMBJKMT4.js +107 -0
- package/dist/chunk-FPN4I4CG.js +3690 -0
- package/dist/chunk-FUXFJTXL.js +3070 -0
- package/dist/chunk-FXFOKD7A.js +449 -0
- package/dist/chunk-FZI4QOAV.js +3996 -0
- package/dist/chunk-FZI4QOAV.js.map +1 -0
- package/dist/chunk-G6SSSX5R.js +158 -0
- package/dist/chunk-GBGCMHBB.js +608 -0
- package/dist/chunk-GIHE7U3Y.js +174 -0
- package/dist/chunk-GJ4GTYOD.js +372 -0
- package/dist/chunk-GLSDWNFV.js +432 -0
- package/dist/chunk-GMGAW3T6.js +278 -0
- package/dist/chunk-GNGI6XFN.js +43 -0
- package/dist/chunk-GO5VIAA7.js +264 -0
- package/dist/chunk-GSW4YHZE.js +229 -0
- package/dist/chunk-GUC6IWEY.js +407 -0
- package/dist/chunk-GWAY3SO5.js +15 -0
- package/dist/chunk-GXOTNT5D.js +168 -0
- package/dist/chunk-GZZCVF76.js +3851 -0
- package/dist/chunk-H4VMHFOX.js +214 -0
- package/dist/chunk-HA5RFQAF.js +110 -0
- package/dist/chunk-HFROJDFQ.js +118 -0
- package/dist/chunk-HHFFPE67.js +220 -0
- package/dist/chunk-HJLHGXWL.js +103 -0
- package/dist/chunk-HKNMNL7B.js +2984 -0
- package/dist/chunk-HT7MBHLY.js +1021 -0
- package/dist/chunk-I5FSUZVW.js +584 -0
- package/dist/chunk-IINQO425.js +246 -0
- package/dist/chunk-IIXNEOK4.js +1022 -0
- package/dist/chunk-IM3WA5AL.js +311 -0
- package/dist/chunk-IX4P4OGR.js +399 -0
- package/dist/chunk-IX5VHZYS.js +129 -0
- package/dist/chunk-JB3TSUZO.js +263 -0
- package/dist/chunk-JIC6RLUB.js +27 -0
- package/dist/chunk-JNJIZCTN.js +172 -0
- package/dist/chunk-JNV5ZPUV.js +828 -0
- package/dist/chunk-JPQFVR24.js +50 -0
- package/dist/chunk-JPZVMXDP.js +1333 -0
- package/dist/chunk-JVPF34MX.js +215 -0
- package/dist/chunk-KED67KAF.js +85 -0
- package/dist/chunk-KJ72GMZ2.js +378 -0
- package/dist/chunk-KTGKGHEA.js +75 -0
- package/dist/chunk-KU77XHWB.js +285 -0
- package/dist/chunk-KVPQUADA.js +5915 -0
- package/dist/chunk-KVPQUADA.js.map +1 -0
- package/dist/chunk-KXBLLFOO.js +249 -0
- package/dist/chunk-L6WVCO6D.js +61 -0
- package/dist/chunk-LIOZ2MXJ.js +380 -0
- package/dist/chunk-LIOZ2MXJ.js.map +1 -0
- package/dist/chunk-LPEFULJY.js +73 -0
- package/dist/chunk-LRMGPO7E.js +98 -0
- package/dist/chunk-LVKTKORH.js +121 -0
- package/dist/chunk-MCPKUVMQ.js +99 -0
- package/dist/chunk-MFLU3466.js +99 -0
- package/dist/chunk-MIUJ3EH5.js +60 -0
- package/dist/chunk-MIUMNTIJ.js +175 -0
- package/dist/chunk-ML46TXRM.js +113 -0
- package/dist/chunk-MO3XJQN2.js +629 -0
- package/dist/chunk-MQRHTOQ2.js +218 -0
- package/dist/chunk-MVYQDBE6.js +79 -0
- package/dist/chunk-NIPON7YB.js +850 -0
- package/dist/chunk-NIPON7YB.js.map +1 -0
- package/dist/chunk-NPBEUU22.js +196 -0
- package/dist/chunk-NSXKGS2K.js +178 -0
- package/dist/chunk-NUEFORM6.js +2317 -0
- package/dist/chunk-NZOFNQNC.js +176 -0
- package/dist/chunk-O664PL2U.js +47 -0
- package/dist/chunk-O664PL2U.js.map +1 -0
- package/dist/chunk-OATXCLTY.js +211 -0
- package/dist/chunk-OG3ELROW.js +538 -0
- package/dist/chunk-OI4WS7FW.js +162 -0
- package/dist/chunk-OITGZUDC.js +82 -0
- package/dist/chunk-OKD2LBMK.js +333 -0
- package/dist/chunk-OLFOGAWU.js +273 -0
- package/dist/chunk-OLFOGAWU.js.map +1 -0
- package/dist/chunk-OSA4CGST.js +134 -0
- package/dist/chunk-OXYAKUFU.js +401 -0
- package/dist/chunk-OYMSMU5O.js +396 -0
- package/dist/chunk-P4NZ72KY.js +162 -0
- package/dist/chunk-PBYL2VIM.js +379 -0
- package/dist/chunk-PDW3OOSZ.js +505 -0
- package/dist/chunk-PGRKTQIW.js +523 -0
- package/dist/chunk-PPQJIVGM.js +175 -0
- package/dist/chunk-PYMQM65Y.js +125 -0
- package/dist/chunk-Q273Q33U.js +166 -0
- package/dist/chunk-Q4CLS2HL.js +340 -0
- package/dist/chunk-QA5UNVHD.js +85 -0
- package/dist/chunk-QFOBUA2J.js +428 -0
- package/dist/chunk-QLIM4D56.js +1095 -0
- package/dist/chunk-QMQF5U2D.js +20 -0
- package/dist/chunk-QNOWKKZ4.js +40 -0
- package/dist/chunk-QPOUPVPD.js +144 -0
- package/dist/chunk-QTJAQ6DS.js +48 -0
- package/dist/chunk-QUOFP3G7.js +404 -0
- package/dist/chunk-QVOTPOXK.js +29 -0
- package/dist/chunk-QYZ5RVGM.js +184 -0
- package/dist/chunk-R7CVDKRN.js +2580 -0
- package/dist/chunk-RB7MXNZD.js +639 -0
- package/dist/chunk-RDZQFZOQ.js +187 -0
- package/dist/chunk-RIHKEGWS.js +194 -0
- package/dist/chunk-ROSB7GF6.js +57 -0
- package/dist/chunk-RP3YMYCX.js +723 -0
- package/dist/chunk-RPHXJHNX.js +271 -0
- package/dist/chunk-RVC3M66H.js +191 -0
- package/dist/chunk-S3OTJAAC.js +283 -0
- package/dist/chunk-SBWPMVRN.js +56 -0
- package/dist/chunk-SERECSAR.js +138 -0
- package/dist/chunk-SHSEF3GJ.js +187 -0
- package/dist/chunk-SMS2M3RG.js +772 -0
- package/dist/chunk-SRDHDIRQ.js +177 -0
- package/dist/chunk-SXRYA7NN.js +389 -0
- package/dist/chunk-SYA3WYG4.js +1187 -0
- package/dist/chunk-SYYFA7W7.js +23 -0
- package/dist/chunk-T2QDSTBH.js +371 -0
- package/dist/chunk-TFSCGFYV.js +251 -0
- package/dist/chunk-TGCKZOSX.js +246 -0
- package/dist/chunk-THILLYQM.js +132 -0
- package/dist/chunk-TI6LGUEZ.js +2412 -0
- package/dist/chunk-TSY6YZL2.js +366 -0
- package/dist/chunk-TW2RHTLH.js +3321 -0
- package/dist/chunk-TWA5G277.js +141 -0
- package/dist/chunk-TZZ2S4XI.js +247 -0
- package/dist/chunk-U5D3K53R.js +58 -0
- package/dist/chunk-UECD27LX.js +251 -0
- package/dist/chunk-UFJDETKG.js +108 -0
- package/dist/chunk-UHCFYX4I.js +570 -0
- package/dist/chunk-UHTURYJO.js +898 -0
- package/dist/chunk-UJH63JT3.js +67 -0
- package/dist/chunk-UOLDS6S5.js +1152 -0
- package/dist/chunk-UUE3OGXI.js +84 -0
- package/dist/chunk-UUNJ2E57.js +391 -0
- package/dist/chunk-UYQVWRAH.js +199 -0
- package/dist/chunk-UYWVK7JQ.js +234 -0
- package/dist/chunk-UYWWUEL4.js +126 -0
- package/dist/chunk-V4CQKX5H.js +48 -0
- package/dist/chunk-V4QM7GDQ.js +3176 -0
- package/dist/chunk-V5Y74WII.js +91 -0
- package/dist/chunk-VGGZLUQK.js +129 -0
- package/dist/chunk-VGX636MB.js +311 -0
- package/dist/chunk-VGZLFQO2.js +773 -0
- package/dist/chunk-VJWZATNF.js +137 -0
- package/dist/chunk-VMWCIC2N.js +50 -0
- package/dist/chunk-VPWKTIU5.js +227 -0
- package/dist/chunk-VXOLG6YB.js +469 -0
- package/dist/chunk-W2NAU5VB.js +1628 -0
- package/dist/chunk-WGORKMR3.js +353 -0
- package/dist/chunk-WMIDELSJ.js +391 -0
- package/dist/chunk-WSOSGL2G.js +383 -0
- package/dist/chunk-WXUUOM4X.js +400 -0
- package/dist/chunk-WZ74QHLE.js +4863 -0
- package/dist/chunk-WZ74QHLE.js.map +1 -0
- package/dist/chunk-X2OWM2ME.js +1870 -0
- package/dist/chunk-X6UMGG4T.js +68 -0
- package/dist/chunk-XDXKB25W.js +93 -0
- package/dist/chunk-XE4PHI74.js +231 -0
- package/dist/chunk-XHF2XNU5.js +73 -0
- package/dist/chunk-XLJ4SQFS.js +230 -0
- package/dist/chunk-XOD4FX6M.js +2434 -0
- package/dist/chunk-XODQ2GPF.js +3110 -0
- package/dist/chunk-XT54RTAM.js +441 -0
- package/dist/chunk-YAVW5OJ5.js +131 -0
- package/dist/chunk-YDQHFJM2.js +83 -0
- package/dist/chunk-YH6O6OQ6.js +1356 -0
- package/dist/chunk-YIKPC2QP.js +794 -0
- package/dist/chunk-ZD7PKYC4.js +335 -0
- package/dist/chunk-ZEQYHEWP.js +406 -0
- package/dist/chunk-ZP3QCPYG.js +21 -0
- package/dist/chunk-ZRVUCTSI.js +265 -0
- package/dist/chunk-ZSI3ITRK.js +449 -0
- package/dist/chunk-ZZMEQCIZ.js +236 -0
- package/dist/components/browser-viewer.d.ts +4 -1
- package/dist/composer.js +35 -35
- package/dist/computer-viewer-ZBY3BPYW.js +21 -0
- package/dist/connect.js +30 -30
- package/dist/connection-step-up-JQ4OFSQN.js +145 -0
- package/dist/desktop-dictation.js +24 -24
- package/dist/desktop.js +2 -2
- package/dist/editor.js +2 -2
- package/dist/embedded-new-voice-ZB5XLKLU.js +25 -0
- package/dist/embedded-voice-MZJISDCS.js +25 -0
- package/dist/fleet-decision-row-LG3SYVR3.js +361 -0
- package/dist/human-input-model.d.ts +2 -0
- package/dist/in-chat-connect-model.js +6 -6
- package/dist/index.js +298 -298
- package/dist/interaction.d.ts +2 -0
- package/dist/interaction.js +11 -9
- package/dist/interaction.js.map +1 -1
- package/dist/latest-question-QWJTXMFA.js +1 -1
- package/dist/machine-request-model.js +1 -1
- package/dist/machines.js +8 -8
- package/dist/meetings-recorder.js +1 -1
- package/dist/meetings.js +116 -116
- package/dist/messages/en.d.ts +12 -0
- package/dist/messages.js +1 -1
- package/dist/model-levels.js +2 -2
- package/dist/model-picker-model.js +2 -2
- package/dist/model-policy-picker-menu-5Y72PLNF.js +23 -0
- package/dist/model-policy.js +1 -1
- package/dist/payment-page-card-YPSXRHBA.js +226 -0
- package/dist/platform-activity-row-ZU4MEBNK.js +156 -0
- package/dist/queue-surface-implementation-6Q25RPH6.js +932 -0
- package/dist/realtime.js +17 -17
- package/dist/recorder-host-JD4GWJ2Z.js +80 -0
- package/dist/recordings.js +3 -3
- package/dist/sandbox-files-HCLEEJMU.js +28 -0
- package/dist/session-app.js +398 -398
- package/dist/session-connect-cards-DRKEN3Z4.js +27 -0
- package/dist/session-list-model.js +3 -3
- package/dist/session-realtime-IZOTTRH6.js +30 -0
- package/dist/session-realtime.js +2 -2
- package/dist/session-ui.js +95 -95
- package/dist/session.js +42 -42
- package/dist/sites.js +3 -3
- package/dist/terminal.js +2 -2
- package/dist/this-computer.js +3 -3
- package/dist/timeline-annotation-markers-WWXNJOXI.js +157 -0
- package/dist/timeline-annotation-selection-ZKRIQFIQ.js +208 -0
- package/dist/timeline-annotations-dialog-4IMKTOXJ.js +283 -0
- package/dist/timeline-model.js +58 -58
- package/dist/ui/access-list.js +23 -23
- package/dist/ui/cadence-picker.js +7 -7
- package/dist/ui/choice-cards.js +3 -3
- package/dist/ui/confirm-dialog.js +2 -2
- package/dist/ui/copy-field.js +3 -3
- package/dist/ui/detail-page.js +5 -5
- package/dist/ui/detail-sheet.js +5 -5
- package/dist/ui/diff-view.js +3 -3
- package/dist/ui/disclosure.js +6 -6
- package/dist/ui/email-chips-input.js +3 -3
- package/dist/ui/field.js +2 -2
- package/dist/ui/flush-form-page.js +7 -7
- package/dist/ui/form-dialog.js +6 -6
- package/dist/ui/list-row.js +6 -6
- package/dist/ui/load-failure.js +3 -3
- package/dist/ui/relative-time.js +3 -3
- package/dist/ui/revision-history.js +13 -13
- package/dist/ui/role-select.js +11 -11
- package/dist/ui/select-menu.js +5 -5
- package/dist/ui/settings-nav.js +6 -6
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/usage-meter.js +4 -4
- package/dist/usage.js +3 -3
- package/dist/workbench.js +11 -11
- package/package.json +5 -6
- package/src/components/browser-viewer.tsx +109 -72
- package/src/components/secret-question-field.tsx +2 -1
- package/src/human-input-model.ts +53 -10
- package/src/interaction.ts +2 -0
- package/src/messages/en.ts +12 -0
- package/src/model-policy.ts +3 -1
- package/dist/browser-viewer-5DCULGWS.js +0 -23
- package/dist/chat-interactive-block-ISMUKH3P.js +0 -22
- package/dist/chunk-22NKV5QE.js +0 -133
- package/dist/chunk-25SCFA2X.js +0 -794
- package/dist/chunk-2NJRDH3Z.js +0 -4480
- package/dist/chunk-2NJRDH3Z.js.map +0 -1
- package/dist/chunk-2O5EDTVB.js +0 -723
- package/dist/chunk-2R7AOT3Y.js +0 -400
- package/dist/chunk-2XQFDRP6.js +0 -234
- package/dist/chunk-34XY4PWB.js +0 -2412
- package/dist/chunk-37J33BLN.js +0 -107
- package/dist/chunk-3AXHBU7K.js +0 -818
- package/dist/chunk-3B4D4BV7.js +0 -270
- package/dist/chunk-3EQMXU5V.js +0 -403
- package/dist/chunk-3QUDVXDR.js +0 -227
- package/dist/chunk-3SKJO525.js +0 -215
- package/dist/chunk-3Y2VSFYS.js +0 -26
- package/dist/chunk-3Y7IJPHB.js +0 -3321
- package/dist/chunk-3YLXGP2I.js +0 -515
- package/dist/chunk-4AUUNEQY.js +0 -15
- package/dist/chunk-4D4XXJJJ.js +0 -379
- package/dist/chunk-4DW5QEAP.js +0 -201
- package/dist/chunk-4KF5I3H5.js +0 -335
- package/dist/chunk-4PG2BEQA.js +0 -175
- package/dist/chunk-4SW3EUNM.js +0 -83
- package/dist/chunk-4T2KWNYX.js +0 -378
- package/dist/chunk-4TTWUMDP.js +0 -168
- package/dist/chunk-4WKITG7P.js +0 -132
- package/dist/chunk-4YXA5UO3.js +0 -287
- package/dist/chunk-4ZCTHNOA.js +0 -298
- package/dist/chunk-52BUMJQB.js +0 -98
- package/dist/chunk-53ZK2JFE.js +0 -538
- package/dist/chunk-5ABIZ7YT.js +0 -371
- package/dist/chunk-5AHIKB3O.js +0 -449
- package/dist/chunk-5DEP55DK.js +0 -251
- package/dist/chunk-5ERDSF2C.js +0 -79
- package/dist/chunk-5G55HNJB.js +0 -412
- package/dist/chunk-62AHHCFV.js +0 -340
- package/dist/chunk-644P2VLV.js +0 -407
- package/dist/chunk-6F34IWSA.js +0 -47
- package/dist/chunk-6F34IWSA.js.map +0 -1
- package/dist/chunk-6QDXVH45.js +0 -114
- package/dist/chunk-6TBA45QF.js +0 -12
- package/dist/chunk-6Y3EFN4Q.js +0 -265
- package/dist/chunk-73P7NEOX.js +0 -52
- package/dist/chunk-7CLQ7RQV.js +0 -828
- package/dist/chunk-7M57K6K5.js +0 -505
- package/dist/chunk-7QORJTVI.js +0 -3690
- package/dist/chunk-ABO54U65.js +0 -108
- package/dist/chunk-ANCI6T7S.js +0 -406
- package/dist/chunk-AO27D7GY.js +0 -1021
- package/dist/chunk-ATQ3O5E6.js +0 -144
- package/dist/chunk-AXBSHKRP.js +0 -246
- package/dist/chunk-AZC5P5PV.js +0 -131
- package/dist/chunk-B6YDINPE.js +0 -68
- package/dist/chunk-BJNSS4UV.js +0 -399
- package/dist/chunk-BKYHS4IH.js +0 -276
- package/dist/chunk-BOCDCQYX.js +0 -41
- package/dist/chunk-BOP5TAUU.js +0 -229
- package/dist/chunk-BPD6VRVH.js +0 -432
- package/dist/chunk-BSAKPNKY.js +0 -263
- package/dist/chunk-BUBEMKK3.js +0 -4845
- package/dist/chunk-BUBEMKK3.js.map +0 -1
- package/dist/chunk-BXKNGFX5.js +0 -5089
- package/dist/chunk-CBHZXVSI.js +0 -207
- package/dist/chunk-CGEAOUXW.js +0 -246
- package/dist/chunk-CGWLKFQF.js +0 -2580
- package/dist/chunk-CIDJMJ44.js +0 -380
- package/dist/chunk-CIDJMJ44.js.map +0 -1
- package/dist/chunk-CNLR3MVZ.js +0 -175
- package/dist/chunk-CPN7JXYV.js +0 -93
- package/dist/chunk-DDCDQ4BF.js +0 -2551
- package/dist/chunk-DK5L6E4G.js +0 -391
- package/dist/chunk-DMDJPQCR.js +0 -5903
- package/dist/chunk-DMDJPQCR.js.map +0 -1
- package/dist/chunk-DNNW2FSP.js +0 -256
- package/dist/chunk-DRPIGAMM.js +0 -4564
- package/dist/chunk-DUZZB4C6.js +0 -283
- package/dist/chunk-DWH35C5X.js +0 -56
- package/dist/chunk-DWW2MA3S.js +0 -278
- package/dist/chunk-E4NQIEA3.js +0 -85
- package/dist/chunk-E4SAFP76.js +0 -112
- package/dist/chunk-EO7NZKIX.js +0 -249
- package/dist/chunk-EQSANTUC.js +0 -84
- package/dist/chunk-EVHNQCEM.js +0 -214
- package/dist/chunk-EVRLHFIG.js +0 -187
- package/dist/chunk-FAVXYNTK.js +0 -67
- package/dist/chunk-FRDJUZ6E.js +0 -91
- package/dist/chunk-FWRKCWQO.js +0 -141
- package/dist/chunk-G65TM5FL.js +0 -166
- package/dist/chunk-G7TU7QDO.js +0 -432
- package/dist/chunk-GGIPEZLL.js +0 -849
- package/dist/chunk-GKA5LFYR.js +0 -21
- package/dist/chunk-GMQFRX2V.js +0 -406
- package/dist/chunk-HE5BTYPR.js +0 -37
- package/dist/chunk-HI6TPRY5.js +0 -1356
- package/dist/chunk-HLNSIXSJ.js +0 -357
- package/dist/chunk-HUKGLWAY.js +0 -174
- package/dist/chunk-HUTQJY3F.js +0 -23
- package/dist/chunk-HWDHA4KS.js +0 -137
- package/dist/chunk-HWDKTGNX.js +0 -1263
- package/dist/chunk-HWOJ7JSO.js +0 -20
- package/dist/chunk-HWOYJOKK.js +0 -266
- package/dist/chunk-HXVKXFIC.js +0 -56
- package/dist/chunk-HYVRYGY3.js +0 -270
- package/dist/chunk-I5ZTAMDP.js +0 -27
- package/dist/chunk-IGVRNMXK.js +0 -154
- package/dist/chunk-IHNCZONS.js +0 -230
- package/dist/chunk-IIUBCLH6.js +0 -437
- package/dist/chunk-IQKLWMIF.js +0 -373
- package/dist/chunk-IQWAFZGW.js +0 -191
- package/dist/chunk-J3GK2LZP.js +0 -292
- package/dist/chunk-J4OOKDRV.js +0 -40
- package/dist/chunk-JBNCFLMW.js +0 -3996
- package/dist/chunk-JBNCFLMW.js.map +0 -1
- package/dist/chunk-JY4ACIKP.js +0 -194
- package/dist/chunk-KDZ7WKYY.js +0 -192
- package/dist/chunk-KGTZGR4F.js +0 -172
- package/dist/chunk-KKIJYI7N.js +0 -351
- package/dist/chunk-KLOB3IXX.js +0 -175
- package/dist/chunk-KMZUIWL6.js +0 -107
- package/dist/chunk-KUYTRUIE.js +0 -214
- package/dist/chunk-KYDLVMKA.js +0 -99
- package/dist/chunk-KZQDP2JM.js +0 -155
- package/dist/chunk-L22AVXXW.js +0 -187
- package/dist/chunk-L5AQCKRR.js +0 -311
- package/dist/chunk-LG3WCCUT.js +0 -188
- package/dist/chunk-LRE7WH6D.js +0 -1095
- package/dist/chunk-LSQP22UI.js +0 -176
- package/dist/chunk-LTNBDO5B.js +0 -72
- package/dist/chunk-LUUFLV27.js +0 -113
- package/dist/chunk-M2KDPKQC.js +0 -126
- package/dist/chunk-M5FX5KH5.js +0 -629
- package/dist/chunk-MD27CX2K.js +0 -1022
- package/dist/chunk-MEUAI3B7.js +0 -199
- package/dist/chunk-MFYH4N6I.js +0 -650
- package/dist/chunk-MPW67ODY.js +0 -639
- package/dist/chunk-MRNOTVGF.js +0 -366
- package/dist/chunk-MTOWY5MX.js +0 -307
- package/dist/chunk-MVLHO6AU.js +0 -441
- package/dist/chunk-N4AHWDN2.js +0 -121
- package/dist/chunk-NABGUV6O.js +0 -48
- package/dist/chunk-NH6OLIQD.js +0 -1628
- package/dist/chunk-NKCK4LBK.js +0 -103
- package/dist/chunk-NNE73MK2.js +0 -1333
- package/dist/chunk-NPKFHO6N.js +0 -584
- package/dist/chunk-NRRRO3NJ.js +0 -851
- package/dist/chunk-NSLCRIQ6.js +0 -386
- package/dist/chunk-NUZNJSL5.js +0 -285
- package/dist/chunk-NYTKZQ2V.js +0 -234
- package/dist/chunk-O4UAH7WR.js +0 -427
- package/dist/chunk-O4UAH7WR.js.map +0 -1
- package/dist/chunk-OAEI3MUO.js +0 -50
- package/dist/chunk-OCWCZRVU.js +0 -3110
- package/dist/chunk-ODR2Q4JQ.js +0 -1236
- package/dist/chunk-ODWNT3XC.js +0 -3176
- package/dist/chunk-OE6XABJ3.js +0 -269
- package/dist/chunk-OEGJWY2U.js +0 -3851
- package/dist/chunk-OHJXHKQT.js +0 -162
- package/dist/chunk-OJE3WTHK.js +0 -391
- package/dist/chunk-OJNZTTQE.js +0 -353
- package/dist/chunk-OMYNOB7U.js +0 -124
- package/dist/chunk-OX234K6A.js +0 -1399
- package/dist/chunk-OYJ7KP6H.js +0 -1152
- package/dist/chunk-OZGG6TS7.js +0 -554
- package/dist/chunk-P5DGNIGZ.js +0 -773
- package/dist/chunk-PCSRHFRF.js +0 -75
- package/dist/chunk-PGDGX6PO.js +0 -178
- package/dist/chunk-PGMXITPB.js +0 -85
- package/dist/chunk-PHNLFMBS.js +0 -158
- package/dist/chunk-PJF47YJJ.js +0 -202
- package/dist/chunk-PMBZMVKE.js +0 -33
- package/dist/chunk-PNLVWZSM.js +0 -211
- package/dist/chunk-PQ7WJAKL.js +0 -74
- package/dist/chunk-PTLRNXWE.js +0 -200
- package/dist/chunk-PTSRBKQC.js +0 -118
- package/dist/chunk-PX64T6XV.js +0 -134
- package/dist/chunk-PYS63BC6.js +0 -138
- package/dist/chunk-QHPB7VSA.js +0 -111
- package/dist/chunk-QJQTLBT3.js +0 -73
- package/dist/chunk-QR74WLXN.js +0 -65
- package/dist/chunk-QZSIADFZ.js +0 -523
- package/dist/chunk-R2T4IUNB.js +0 -29
- package/dist/chunk-R6CFPY3F.js +0 -278
- package/dist/chunk-R6OBJ7LF.js +0 -131
- package/dist/chunk-R6WQLIFX.js +0 -73
- package/dist/chunk-R7QHNWYL.js +0 -1309
- package/dist/chunk-R7ZIFQ7D.js +0 -738
- package/dist/chunk-R7ZIFQ7D.js.map +0 -1
- package/dist/chunk-RCKXQ2RY.js +0 -3070
- package/dist/chunk-RCN3SVJC.js +0 -211
- package/dist/chunk-RDTZN6HR.js +0 -372
- package/dist/chunk-RET43Z3F.js +0 -43
- package/dist/chunk-REUQ464X.js +0 -898
- package/dist/chunk-RIOTQESW.js +0 -107
- package/dist/chunk-RPJC2JCE.js +0 -209
- package/dist/chunk-RT2GW3LO.js +0 -10035
- package/dist/chunk-RT2GW3LO.js.map +0 -1
- package/dist/chunk-RULIWGQ6.js +0 -2984
- package/dist/chunk-RWZ5XML5.js +0 -103
- package/dist/chunk-RYWPD5WU.js +0 -572
- package/dist/chunk-RYYBQ4PW.js +0 -129
- package/dist/chunk-S44ADSZG.js +0 -236
- package/dist/chunk-SB3LGY34.js +0 -27
- package/dist/chunk-SG4FA5CX.js +0 -33
- package/dist/chunk-SMCHRNUL.js +0 -129
- package/dist/chunk-SMSEI6VH.js +0 -184
- package/dist/chunk-SNACGK3Z.js +0 -177
- package/dist/chunk-SOZTO34S.js +0 -2553
- package/dist/chunk-SP7XRRGB.js +0 -428
- package/dist/chunk-STA75WRF.js +0 -383
- package/dist/chunk-SUO5NPEX.js +0 -318
- package/dist/chunk-T2NC7ALH.js +0 -333
- package/dist/chunk-T3OUZVHU.js +0 -250
- package/dist/chunk-T4YOQ6DF.js +0 -789
- package/dist/chunk-TGG3ODCS.js +0 -99
- package/dist/chunk-TLR2SX7T.js +0 -2317
- package/dist/chunk-TXCGPEWC.js +0 -243
- package/dist/chunk-TXCGPEWC.js.map +0 -1
- package/dist/chunk-TZGJPDZL.js +0 -259
- package/dist/chunk-U7KNZEMU.js +0 -271
- package/dist/chunk-UDDZDC2Q.js +0 -772
- package/dist/chunk-UFIETNB2.js +0 -469
- package/dist/chunk-UFRXYZCJ.js +0 -125
- package/dist/chunk-UILJ5INQ.js +0 -170
- package/dist/chunk-UJ4DLPYG.js +0 -449
- package/dist/chunk-UKDLZ76A.js +0 -2434
- package/dist/chunk-UMYCZQSL.js +0 -1870
- package/dist/chunk-UPRN4FBY.js +0 -38
- package/dist/chunk-UQBYKWGG.js +0 -311
- package/dist/chunk-UQR5RZ5I.js +0 -218
- package/dist/chunk-UWPSCSIZ.js +0 -57
- package/dist/chunk-UYLO2JP2.js +0 -158
- package/dist/chunk-V2YSF3MJ.js +0 -114
- package/dist/chunk-VAJQQKSG.js +0 -283
- package/dist/chunk-VDHWFRTL.js +0 -58
- package/dist/chunk-VLDKWGHD.js +0 -61
- package/dist/chunk-VLODMRE3.js +0 -138
- package/dist/chunk-VM6BM3NV.js +0 -389
- package/dist/chunk-VRVB2XSO.js +0 -117
- package/dist/chunk-W2PBDF4F.js +0 -231
- package/dist/chunk-W7BNYXRT.js +0 -296
- package/dist/chunk-WCA777NS.js +0 -1187
- package/dist/chunk-WDDAHRBC.js +0 -404
- package/dist/chunk-WEXKKIPB.js +0 -1024
- package/dist/chunk-WG7OVUCV.js +0 -401
- package/dist/chunk-WMW4AXVG.js +0 -570
- package/dist/chunk-WRMMZYZC.js +0 -931
- package/dist/chunk-WYICOILE.js +0 -50
- package/dist/chunk-WYNXSYTH.js +0 -532
- package/dist/chunk-X62OJCQW.js +0 -234
- package/dist/chunk-XBFNNP6B.js +0 -608
- package/dist/chunk-XDXPGA3N.js +0 -850
- package/dist/chunk-XDXPGA3N.js.map +0 -1
- package/dist/chunk-XFP3AIZO.js +0 -247
- package/dist/chunk-XSL5GKL3.js +0 -110
- package/dist/chunk-XVXYLCSC.js +0 -82
- package/dist/chunk-XX2J7H2J.js +0 -196
- package/dist/chunk-Y6CNWBV3.js +0 -264
- package/dist/chunk-YEFIICAN.js +0 -46
- package/dist/chunk-YJBRNXFL.js +0 -1184
- package/dist/chunk-YP4SNX4P.js +0 -220
- package/dist/chunk-YQ6AYWGT.js +0 -162
- package/dist/chunk-YWKJSF3R.js +0 -396
- package/dist/chunk-Z3EQ3XBB.js +0 -114
- package/dist/chunk-ZD67RM6G.js +0 -60
- package/dist/chunk-ZMCVED5L.js +0 -1185
- package/dist/chunk-ZOTNM76R.js +0 -42
- package/dist/chunk-ZP7BJXQ5.js +0 -113
- package/dist/chunk-ZRNDPAED.js +0 -274
- package/dist/chunk-ZUQKQP3T.js +0 -251
- package/dist/chunk-ZVT2KQTH.js +0 -48
- package/dist/chunk-ZXDIEGD5.js +0 -1019
- package/dist/computer-viewer-KLRAA56S.js +0 -21
- package/dist/connection-step-up-PWIIW3KK.js +0 -145
- package/dist/embedded-new-voice-P2RCFI3X.js +0 -25
- package/dist/embedded-voice-HY5F4D2I.js +0 -25
- package/dist/fleet-decision-row-UEXT7NAN.js +0 -361
- package/dist/model-policy-picker-menu-AAGNLTEG.js +0 -23
- package/dist/payment-page-card-MHTYJHCW.js +0 -226
- package/dist/platform-activity-row-7VAPGRZQ.js +0 -156
- package/dist/queue-surface-implementation-AE5P3PSA.js +0 -932
- package/dist/recorder-host-I53BQIRX.js +0 -80
- package/dist/sandbox-files-LGE7EDX2.js +0 -28
- package/dist/session-connect-cards-QNL7WRKJ.js +0 -27
- package/dist/session-realtime-ZMXMK5EV.js +0 -30
- package/dist/timeline-annotation-markers-5RICTVVW.js +0 -157
- package/dist/timeline-annotation-selection-ITAHBOFW.js +0 -208
- package/dist/timeline-annotations-dialog-7PGBTPVD.js +0 -283
- /package/dist/{browser-viewer-5DCULGWS.js.map → browser-viewer-EIEMRVFF.js.map} +0 -0
- /package/dist/{chat-interactive-block-ISMUKH3P.js.map → chat-interactive-block-FV37LWYZ.js.map} +0 -0
- /package/dist/{chunk-3AXHBU7K.js.map → chunk-2COBAJC7.js.map} +0 -0
- /package/dist/{chunk-UILJ5INQ.js.map → chunk-2HS3IUXE.js.map} +0 -0
- /package/dist/{chunk-W7BNYXRT.js.map → chunk-2JTMFYCT.js.map} +0 -0
- /package/dist/{chunk-V2YSF3MJ.js.map → chunk-2JXKP4M6.js.map} +0 -0
- /package/dist/{chunk-OE6XABJ3.js.map → chunk-2P5K7CBH.js.map} +0 -0
- /package/dist/{chunk-T3OUZVHU.js.map → chunk-2XGRHMRI.js.map} +0 -0
- /package/dist/{chunk-QR74WLXN.js.map → chunk-332BYSAZ.js.map} +0 -0
- /package/dist/{chunk-UYLO2JP2.js.map → chunk-3EM5GTP3.js.map} +0 -0
- /package/dist/{chunk-73P7NEOX.js.map → chunk-3L5ATO4A.js.map} +0 -0
- /package/dist/{chunk-RIOTQESW.js.map → chunk-3S3PJB7J.js.map} +0 -0
- /package/dist/{chunk-HYVRYGY3.js.map → chunk-3SBKYPNM.js.map} +0 -0
- /package/dist/{chunk-6QDXVH45.js.map → chunk-3Z7VA6ET.js.map} +0 -0
- /package/dist/{chunk-CBHZXVSI.js.map → chunk-43BRJBEV.js.map} +0 -0
- /package/dist/{chunk-LG3WCCUT.js.map → chunk-46LZO4ZO.js.map} +0 -0
- /package/dist/{chunk-UPRN4FBY.js.map → chunk-46ZC5VNC.js.map} +0 -0
- /package/dist/{chunk-4ZCTHNOA.js.map → chunk-4AH4EEHE.js.map} +0 -0
- /package/dist/{chunk-3B4D4BV7.js.map → chunk-4D3YJNVN.js.map} +0 -0
- /package/dist/{chunk-HE5BTYPR.js.map → chunk-4I4RTI4D.js.map} +0 -0
- /package/dist/{chunk-4YXA5UO3.js.map → chunk-4KASGJTF.js.map} +0 -0
- /package/dist/{chunk-HWDKTGNX.js.map → chunk-4RUKLIOF.js.map} +0 -0
- /package/dist/{chunk-MFYH4N6I.js.map → chunk-4UU7FN3I.js.map} +0 -0
- /package/dist/{chunk-DDCDQ4BF.js.map → chunk-4ZRNASBF.js.map} +0 -0
- /package/dist/{chunk-BOCDCQYX.js.map → chunk-5EJBPQI2.js.map} +0 -0
- /package/dist/{chunk-RPJC2JCE.js.map → chunk-5G4IGG7F.js.map} +0 -0
- /package/dist/{chunk-AZC5P5PV.js.map → chunk-5JAYZOAW.js.map} +0 -0
- /package/dist/{chunk-T4YOQ6DF.js.map → chunk-5JOKVDSR.js.map} +0 -0
- /package/dist/{chunk-ODR2Q4JQ.js.map → chunk-5MP3G7ZV.js.map} +0 -0
- /package/dist/{chunk-ZOTNM76R.js.map → chunk-5OVRMKP5.js.map} +0 -0
- /package/dist/{chunk-YJBRNXFL.js.map → chunk-5SGTRULO.js.map} +0 -0
- /package/dist/{chunk-RYWPD5WU.js.map → chunk-5SOL4INY.js.map} +0 -0
- /package/dist/{chunk-SB3LGY34.js.map → chunk-5Y34P32B.js.map} +0 -0
- /package/dist/{chunk-LTNBDO5B.js.map → chunk-62HIKJ5F.js.map} +0 -0
- /package/dist/{chunk-HWOYJOKK.js.map → chunk-62T2ZPD5.js.map} +0 -0
- /package/dist/{chunk-NSLCRIQ6.js.map → chunk-63VNZRLY.js.map} +0 -0
- /package/dist/{chunk-PMBZMVKE.js.map → chunk-6CDBX3XG.js.map} +0 -0
- /package/dist/{chunk-R6CFPY3F.js.map → chunk-6D3D2JWY.js.map} +0 -0
- /package/dist/{chunk-4DW5QEAP.js.map → chunk-6DOIINY4.js.map} +0 -0
- /package/dist/{chunk-E4SAFP76.js.map → chunk-6DQBUKGJ.js.map} +0 -0
- /package/dist/{chunk-OX234K6A.js.map → chunk-6SETNFNH.js.map} +0 -0
- /package/dist/{chunk-HXVKXFIC.js.map → chunk-6XYFMHNT.js.map} +0 -0
- /package/dist/{chunk-SG4FA5CX.js.map → chunk-6YU3WV2P.js.map} +0 -0
- /package/dist/{chunk-KKIJYI7N.js.map → chunk-6YUHDFOZ.js.map} +0 -0
- /package/dist/{chunk-ZMCVED5L.js.map → chunk-72EOXOR7.js.map} +0 -0
- /package/dist/{chunk-WYNXSYTH.js.map → chunk-72ND4ALI.js.map} +0 -0
- /package/dist/{chunk-DUZZB4C6.js.map → chunk-757LE32E.js.map} +0 -0
- /package/dist/{chunk-VLODMRE3.js.map → chunk-7S2S4MXR.js.map} +0 -0
- /package/dist/{chunk-PTLRNXWE.js.map → chunk-7SYCHMXS.js.map} +0 -0
- /package/dist/{chunk-BXKNGFX5.js.map → chunk-7TVAPQOV.js.map} +0 -0
- /package/dist/{chunk-EVHNQCEM.js.map → chunk-7UDLRDHK.js.map} +0 -0
- /package/dist/{chunk-HLNSIXSJ.js.map → chunk-7YLQCMZP.js.map} +0 -0
- /package/dist/{chunk-GGIPEZLL.js.map → chunk-A5GX3CAE.js.map} +0 -0
- /package/dist/{chunk-SUO5NPEX.js.map → chunk-A7EBV2EB.js.map} +0 -0
- /package/dist/{chunk-Z3EQ3XBB.js.map → chunk-AB5SPXUR.js.map} +0 -0
- /package/dist/{chunk-PJF47YJJ.js.map → chunk-AHVQGL5A.js.map} +0 -0
- /package/dist/{chunk-3Y2VSFYS.js.map → chunk-AI77ZKEV.js.map} +0 -0
- /package/dist/{chunk-ZXDIEGD5.js.map → chunk-AIX2D6RB.js.map} +0 -0
- /package/dist/{chunk-KDZ7WKYY.js.map → chunk-AVSIHP7Q.js.map} +0 -0
- /package/dist/{chunk-37J33BLN.js.map → chunk-AWK23Q32.js.map} +0 -0
- /package/dist/{chunk-G7TU7QDO.js.map → chunk-AYVWA6KD.js.map} +0 -0
- /package/dist/{chunk-SOZTO34S.js.map → chunk-AYZXE4IM.js.map} +0 -0
- /package/dist/{chunk-OMYNOB7U.js.map → chunk-AZGGSPTE.js.map} +0 -0
- /package/dist/{chunk-WRMMZYZC.js.map → chunk-B45TB4HY.js.map} +0 -0
- /package/dist/{chunk-YEFIICAN.js.map → chunk-BIUJHNVR.js.map} +0 -0
- /package/dist/{chunk-NYTKZQ2V.js.map → chunk-BJUOKUE5.js.map} +0 -0
- /package/dist/{chunk-J3GK2LZP.js.map → chunk-BPEEVMKH.js.map} +0 -0
- /package/dist/{chunk-PQ7WJAKL.js.map → chunk-BPHPAGYF.js.map} +0 -0
- /package/dist/{chunk-MTOWY5MX.js.map → chunk-BXMND6YU.js.map} +0 -0
- /package/dist/{chunk-VRVB2XSO.js.map → chunk-C6OM2SRG.js.map} +0 -0
- /package/dist/{chunk-R7QHNWYL.js.map → chunk-CIRCUDKF.js.map} +0 -0
- /package/dist/{chunk-3EQMXU5V.js.map → chunk-CLKR4UG3.js.map} +0 -0
- /package/dist/{chunk-OZGG6TS7.js.map → chunk-CPX6BHER.js.map} +0 -0
- /package/dist/{chunk-KZQDP2JM.js.map → chunk-CVC4RO7D.js.map} +0 -0
- /package/dist/{chunk-NKCK4LBK.js.map → chunk-D3YJAQGK.js.map} +0 -0
- /package/dist/{chunk-WEXKKIPB.js.map → chunk-DFQ72BLS.js.map} +0 -0
- /package/dist/{chunk-DRPIGAMM.js.map → chunk-DG65PJOZ.js.map} +0 -0
- /package/dist/{chunk-GMQFRX2V.js.map → chunk-DNAXAS5R.js.map} +0 -0
- /package/dist/{chunk-CNLR3MVZ.js.map → chunk-DO247ITS.js.map} +0 -0
- /package/dist/{chunk-IGVRNMXK.js.map → chunk-DONBARLL.js.map} +0 -0
- /package/dist/{chunk-IQKLWMIF.js.map → chunk-DTLXQ3ZU.js.map} +0 -0
- /package/dist/{chunk-ZRNDPAED.js.map → chunk-EAXTACI4.js.map} +0 -0
- /package/dist/{chunk-5G55HNJB.js.map → chunk-EDPH7AJH.js.map} +0 -0
- /package/dist/{chunk-BKYHS4IH.js.map → chunk-EFKQHCGJ.js.map} +0 -0
- /package/dist/{chunk-22NKV5QE.js.map → chunk-EILSPMVD.js.map} +0 -0
- /package/dist/{chunk-PNLVWZSM.js.map → chunk-EK7KIETS.js.map} +0 -0
- /package/dist/{chunk-IIUBCLH6.js.map → chunk-EMWT6GOK.js.map} +0 -0
- /package/dist/{chunk-TZGJPDZL.js.map → chunk-EO22NST7.js.map} +0 -0
- /package/dist/{chunk-DNNW2FSP.js.map → chunk-ER5MYLIE.js.map} +0 -0
- /package/dist/{chunk-2XQFDRP6.js.map → chunk-ES5HKVQF.js.map} +0 -0
- /package/dist/{chunk-QHPB7VSA.js.map → chunk-F26YBYAZ.js.map} +0 -0
- /package/dist/{chunk-3YLXGP2I.js.map → chunk-F6QP4GSK.js.map} +0 -0
- /package/dist/{chunk-NRRRO3NJ.js.map → chunk-F7QEO7M2.js.map} +0 -0
- /package/dist/{chunk-6TBA45QF.js.map → chunk-FJFGDLXB.js.map} +0 -0
- /package/dist/{chunk-LUUFLV27.js.map → chunk-FLLJ2WXW.js.map} +0 -0
- /package/dist/{chunk-KMZUIWL6.js.map → chunk-FMBJKMT4.js.map} +0 -0
- /package/dist/{chunk-7QORJTVI.js.map → chunk-FPN4I4CG.js.map} +0 -0
- /package/dist/{chunk-RCKXQ2RY.js.map → chunk-FUXFJTXL.js.map} +0 -0
- /package/dist/{chunk-5AHIKB3O.js.map → chunk-FXFOKD7A.js.map} +0 -0
- /package/dist/{chunk-PHNLFMBS.js.map → chunk-G6SSSX5R.js.map} +0 -0
- /package/dist/{chunk-XBFNNP6B.js.map → chunk-GBGCMHBB.js.map} +0 -0
- /package/dist/{chunk-HUKGLWAY.js.map → chunk-GIHE7U3Y.js.map} +0 -0
- /package/dist/{chunk-RDTZN6HR.js.map → chunk-GJ4GTYOD.js.map} +0 -0
- /package/dist/{chunk-BPD6VRVH.js.map → chunk-GLSDWNFV.js.map} +0 -0
- /package/dist/{chunk-DWW2MA3S.js.map → chunk-GMGAW3T6.js.map} +0 -0
- /package/dist/{chunk-RET43Z3F.js.map → chunk-GNGI6XFN.js.map} +0 -0
- /package/dist/{chunk-Y6CNWBV3.js.map → chunk-GO5VIAA7.js.map} +0 -0
- /package/dist/{chunk-BOP5TAUU.js.map → chunk-GSW4YHZE.js.map} +0 -0
- /package/dist/{chunk-644P2VLV.js.map → chunk-GUC6IWEY.js.map} +0 -0
- /package/dist/{chunk-4AUUNEQY.js.map → chunk-GWAY3SO5.js.map} +0 -0
- /package/dist/{chunk-4TTWUMDP.js.map → chunk-GXOTNT5D.js.map} +0 -0
- /package/dist/{chunk-OEGJWY2U.js.map → chunk-GZZCVF76.js.map} +0 -0
- /package/dist/{chunk-KUYTRUIE.js.map → chunk-H4VMHFOX.js.map} +0 -0
- /package/dist/{chunk-XSL5GKL3.js.map → chunk-HA5RFQAF.js.map} +0 -0
- /package/dist/{chunk-PTSRBKQC.js.map → chunk-HFROJDFQ.js.map} +0 -0
- /package/dist/{chunk-YP4SNX4P.js.map → chunk-HHFFPE67.js.map} +0 -0
- /package/dist/{chunk-RWZ5XML5.js.map → chunk-HJLHGXWL.js.map} +0 -0
- /package/dist/{chunk-RULIWGQ6.js.map → chunk-HKNMNL7B.js.map} +0 -0
- /package/dist/{chunk-AO27D7GY.js.map → chunk-HT7MBHLY.js.map} +0 -0
- /package/dist/{chunk-NPKFHO6N.js.map → chunk-I5FSUZVW.js.map} +0 -0
- /package/dist/{chunk-AXBSHKRP.js.map → chunk-IINQO425.js.map} +0 -0
- /package/dist/{chunk-MD27CX2K.js.map → chunk-IIXNEOK4.js.map} +0 -0
- /package/dist/{chunk-UQBYKWGG.js.map → chunk-IM3WA5AL.js.map} +0 -0
- /package/dist/{chunk-BJNSS4UV.js.map → chunk-IX4P4OGR.js.map} +0 -0
- /package/dist/{chunk-SMCHRNUL.js.map → chunk-IX5VHZYS.js.map} +0 -0
- /package/dist/{chunk-BSAKPNKY.js.map → chunk-JB3TSUZO.js.map} +0 -0
- /package/dist/{chunk-I5ZTAMDP.js.map → chunk-JIC6RLUB.js.map} +0 -0
- /package/dist/{chunk-KGTZGR4F.js.map → chunk-JNJIZCTN.js.map} +0 -0
- /package/dist/{chunk-7CLQ7RQV.js.map → chunk-JNV5ZPUV.js.map} +0 -0
- /package/dist/{chunk-OAEI3MUO.js.map → chunk-JPQFVR24.js.map} +0 -0
- /package/dist/{chunk-NNE73MK2.js.map → chunk-JPZVMXDP.js.map} +0 -0
- /package/dist/{chunk-3SKJO525.js.map → chunk-JVPF34MX.js.map} +0 -0
- /package/dist/{chunk-E4NQIEA3.js.map → chunk-KED67KAF.js.map} +0 -0
- /package/dist/{chunk-4T2KWNYX.js.map → chunk-KJ72GMZ2.js.map} +0 -0
- /package/dist/{chunk-PCSRHFRF.js.map → chunk-KTGKGHEA.js.map} +0 -0
- /package/dist/{chunk-NUZNJSL5.js.map → chunk-KU77XHWB.js.map} +0 -0
- /package/dist/{chunk-EO7NZKIX.js.map → chunk-KXBLLFOO.js.map} +0 -0
- /package/dist/{chunk-VLDKWGHD.js.map → chunk-L6WVCO6D.js.map} +0 -0
- /package/dist/{chunk-QJQTLBT3.js.map → chunk-LPEFULJY.js.map} +0 -0
- /package/dist/{chunk-52BUMJQB.js.map → chunk-LRMGPO7E.js.map} +0 -0
- /package/dist/{chunk-N4AHWDN2.js.map → chunk-LVKTKORH.js.map} +0 -0
- /package/dist/{chunk-TGG3ODCS.js.map → chunk-MCPKUVMQ.js.map} +0 -0
- /package/dist/{chunk-KYDLVMKA.js.map → chunk-MFLU3466.js.map} +0 -0
- /package/dist/{chunk-ZD67RM6G.js.map → chunk-MIUJ3EH5.js.map} +0 -0
- /package/dist/{chunk-KLOB3IXX.js.map → chunk-MIUMNTIJ.js.map} +0 -0
- /package/dist/{chunk-ZP7BJXQ5.js.map → chunk-ML46TXRM.js.map} +0 -0
- /package/dist/{chunk-M5FX5KH5.js.map → chunk-MO3XJQN2.js.map} +0 -0
- /package/dist/{chunk-UQR5RZ5I.js.map → chunk-MQRHTOQ2.js.map} +0 -0
- /package/dist/{chunk-5ERDSF2C.js.map → chunk-MVYQDBE6.js.map} +0 -0
- /package/dist/{chunk-XX2J7H2J.js.map → chunk-NPBEUU22.js.map} +0 -0
- /package/dist/{chunk-PGDGX6PO.js.map → chunk-NSXKGS2K.js.map} +0 -0
- /package/dist/{chunk-TLR2SX7T.js.map → chunk-NUEFORM6.js.map} +0 -0
- /package/dist/{chunk-LSQP22UI.js.map → chunk-NZOFNQNC.js.map} +0 -0
- /package/dist/{chunk-RCN3SVJC.js.map → chunk-OATXCLTY.js.map} +0 -0
- /package/dist/{chunk-53ZK2JFE.js.map → chunk-OG3ELROW.js.map} +0 -0
- /package/dist/{chunk-YQ6AYWGT.js.map → chunk-OI4WS7FW.js.map} +0 -0
- /package/dist/{chunk-XVXYLCSC.js.map → chunk-OITGZUDC.js.map} +0 -0
- /package/dist/{chunk-T2NC7ALH.js.map → chunk-OKD2LBMK.js.map} +0 -0
- /package/dist/{chunk-PX64T6XV.js.map → chunk-OSA4CGST.js.map} +0 -0
- /package/dist/{chunk-WG7OVUCV.js.map → chunk-OXYAKUFU.js.map} +0 -0
- /package/dist/{chunk-YWKJSF3R.js.map → chunk-OYMSMU5O.js.map} +0 -0
- /package/dist/{chunk-OHJXHKQT.js.map → chunk-P4NZ72KY.js.map} +0 -0
- /package/dist/{chunk-4D4XXJJJ.js.map → chunk-PBYL2VIM.js.map} +0 -0
- /package/dist/{chunk-7M57K6K5.js.map → chunk-PDW3OOSZ.js.map} +0 -0
- /package/dist/{chunk-QZSIADFZ.js.map → chunk-PGRKTQIW.js.map} +0 -0
- /package/dist/{chunk-4PG2BEQA.js.map → chunk-PPQJIVGM.js.map} +0 -0
- /package/dist/{chunk-UFRXYZCJ.js.map → chunk-PYMQM65Y.js.map} +0 -0
- /package/dist/{chunk-G65TM5FL.js.map → chunk-Q273Q33U.js.map} +0 -0
- /package/dist/{chunk-62AHHCFV.js.map → chunk-Q4CLS2HL.js.map} +0 -0
- /package/dist/{chunk-PGMXITPB.js.map → chunk-QA5UNVHD.js.map} +0 -0
- /package/dist/{chunk-SP7XRRGB.js.map → chunk-QFOBUA2J.js.map} +0 -0
- /package/dist/{chunk-LRE7WH6D.js.map → chunk-QLIM4D56.js.map} +0 -0
- /package/dist/{chunk-HWOJ7JSO.js.map → chunk-QMQF5U2D.js.map} +0 -0
- /package/dist/{chunk-J4OOKDRV.js.map → chunk-QNOWKKZ4.js.map} +0 -0
- /package/dist/{chunk-ATQ3O5E6.js.map → chunk-QPOUPVPD.js.map} +0 -0
- /package/dist/{chunk-ZVT2KQTH.js.map → chunk-QTJAQ6DS.js.map} +0 -0
- /package/dist/{chunk-WDDAHRBC.js.map → chunk-QUOFP3G7.js.map} +0 -0
- /package/dist/{chunk-R2T4IUNB.js.map → chunk-QVOTPOXK.js.map} +0 -0
- /package/dist/{chunk-SMSEI6VH.js.map → chunk-QYZ5RVGM.js.map} +0 -0
- /package/dist/{chunk-CGWLKFQF.js.map → chunk-R7CVDKRN.js.map} +0 -0
- /package/dist/{chunk-MPW67ODY.js.map → chunk-RB7MXNZD.js.map} +0 -0
- /package/dist/{chunk-EVRLHFIG.js.map → chunk-RDZQFZOQ.js.map} +0 -0
- /package/dist/{chunk-JY4ACIKP.js.map → chunk-RIHKEGWS.js.map} +0 -0
- /package/dist/{chunk-UWPSCSIZ.js.map → chunk-ROSB7GF6.js.map} +0 -0
- /package/dist/{chunk-2O5EDTVB.js.map → chunk-RP3YMYCX.js.map} +0 -0
- /package/dist/{chunk-U7KNZEMU.js.map → chunk-RPHXJHNX.js.map} +0 -0
- /package/dist/{chunk-IQWAFZGW.js.map → chunk-RVC3M66H.js.map} +0 -0
- /package/dist/{chunk-VAJQQKSG.js.map → chunk-S3OTJAAC.js.map} +0 -0
- /package/dist/{chunk-DWH35C5X.js.map → chunk-SBWPMVRN.js.map} +0 -0
- /package/dist/{chunk-PYS63BC6.js.map → chunk-SERECSAR.js.map} +0 -0
- /package/dist/{chunk-L22AVXXW.js.map → chunk-SHSEF3GJ.js.map} +0 -0
- /package/dist/{chunk-UDDZDC2Q.js.map → chunk-SMS2M3RG.js.map} +0 -0
- /package/dist/{chunk-SNACGK3Z.js.map → chunk-SRDHDIRQ.js.map} +0 -0
- /package/dist/{chunk-VM6BM3NV.js.map → chunk-SXRYA7NN.js.map} +0 -0
- /package/dist/{chunk-WCA777NS.js.map → chunk-SYA3WYG4.js.map} +0 -0
- /package/dist/{chunk-HUTQJY3F.js.map → chunk-SYYFA7W7.js.map} +0 -0
- /package/dist/{chunk-5ABIZ7YT.js.map → chunk-T2QDSTBH.js.map} +0 -0
- /package/dist/{chunk-ZUQKQP3T.js.map → chunk-TFSCGFYV.js.map} +0 -0
- /package/dist/{chunk-CGEAOUXW.js.map → chunk-TGCKZOSX.js.map} +0 -0
- /package/dist/{chunk-4WKITG7P.js.map → chunk-THILLYQM.js.map} +0 -0
- /package/dist/{chunk-34XY4PWB.js.map → chunk-TI6LGUEZ.js.map} +0 -0
- /package/dist/{chunk-MRNOTVGF.js.map → chunk-TSY6YZL2.js.map} +0 -0
- /package/dist/{chunk-3Y7IJPHB.js.map → chunk-TW2RHTLH.js.map} +0 -0
- /package/dist/{chunk-FWRKCWQO.js.map → chunk-TWA5G277.js.map} +0 -0
- /package/dist/{chunk-XFP3AIZO.js.map → chunk-TZZ2S4XI.js.map} +0 -0
- /package/dist/{chunk-VDHWFRTL.js.map → chunk-U5D3K53R.js.map} +0 -0
- /package/dist/{chunk-5DEP55DK.js.map → chunk-UECD27LX.js.map} +0 -0
- /package/dist/{chunk-ABO54U65.js.map → chunk-UFJDETKG.js.map} +0 -0
- /package/dist/{chunk-WMW4AXVG.js.map → chunk-UHCFYX4I.js.map} +0 -0
- /package/dist/{chunk-REUQ464X.js.map → chunk-UHTURYJO.js.map} +0 -0
- /package/dist/{chunk-FAVXYNTK.js.map → chunk-UJH63JT3.js.map} +0 -0
- /package/dist/{chunk-OYJ7KP6H.js.map → chunk-UOLDS6S5.js.map} +0 -0
- /package/dist/{chunk-EQSANTUC.js.map → chunk-UUE3OGXI.js.map} +0 -0
- /package/dist/{chunk-OJE3WTHK.js.map → chunk-UUNJ2E57.js.map} +0 -0
- /package/dist/{chunk-MEUAI3B7.js.map → chunk-UYQVWRAH.js.map} +0 -0
- /package/dist/{chunk-X62OJCQW.js.map → chunk-UYWVK7JQ.js.map} +0 -0
- /package/dist/{chunk-M2KDPKQC.js.map → chunk-UYWWUEL4.js.map} +0 -0
- /package/dist/{chunk-NABGUV6O.js.map → chunk-V4CQKX5H.js.map} +0 -0
- /package/dist/{chunk-ODWNT3XC.js.map → chunk-V4QM7GDQ.js.map} +0 -0
- /package/dist/{chunk-FRDJUZ6E.js.map → chunk-V5Y74WII.js.map} +0 -0
- /package/dist/{chunk-RYYBQ4PW.js.map → chunk-VGGZLUQK.js.map} +0 -0
- /package/dist/{chunk-L5AQCKRR.js.map → chunk-VGX636MB.js.map} +0 -0
- /package/dist/{chunk-P5DGNIGZ.js.map → chunk-VGZLFQO2.js.map} +0 -0
- /package/dist/{chunk-HWDHA4KS.js.map → chunk-VJWZATNF.js.map} +0 -0
- /package/dist/{chunk-WYICOILE.js.map → chunk-VMWCIC2N.js.map} +0 -0
- /package/dist/{chunk-3QUDVXDR.js.map → chunk-VPWKTIU5.js.map} +0 -0
- /package/dist/{chunk-UFIETNB2.js.map → chunk-VXOLG6YB.js.map} +0 -0
- /package/dist/{chunk-NH6OLIQD.js.map → chunk-W2NAU5VB.js.map} +0 -0
- /package/dist/{chunk-OJNZTTQE.js.map → chunk-WGORKMR3.js.map} +0 -0
- /package/dist/{chunk-DK5L6E4G.js.map → chunk-WMIDELSJ.js.map} +0 -0
- /package/dist/{chunk-STA75WRF.js.map → chunk-WSOSGL2G.js.map} +0 -0
- /package/dist/{chunk-2R7AOT3Y.js.map → chunk-WXUUOM4X.js.map} +0 -0
- /package/dist/{chunk-UMYCZQSL.js.map → chunk-X2OWM2ME.js.map} +0 -0
- /package/dist/{chunk-B6YDINPE.js.map → chunk-X6UMGG4T.js.map} +0 -0
- /package/dist/{chunk-CPN7JXYV.js.map → chunk-XDXKB25W.js.map} +0 -0
- /package/dist/{chunk-W2PBDF4F.js.map → chunk-XE4PHI74.js.map} +0 -0
- /package/dist/{chunk-R6WQLIFX.js.map → chunk-XHF2XNU5.js.map} +0 -0
- /package/dist/{chunk-IHNCZONS.js.map → chunk-XLJ4SQFS.js.map} +0 -0
- /package/dist/{chunk-UKDLZ76A.js.map → chunk-XOD4FX6M.js.map} +0 -0
- /package/dist/{chunk-OCWCZRVU.js.map → chunk-XODQ2GPF.js.map} +0 -0
- /package/dist/{chunk-MVLHO6AU.js.map → chunk-XT54RTAM.js.map} +0 -0
- /package/dist/{chunk-R6OBJ7LF.js.map → chunk-YAVW5OJ5.js.map} +0 -0
- /package/dist/{chunk-4SW3EUNM.js.map → chunk-YDQHFJM2.js.map} +0 -0
- /package/dist/{chunk-HI6TPRY5.js.map → chunk-YH6O6OQ6.js.map} +0 -0
- /package/dist/{chunk-25SCFA2X.js.map → chunk-YIKPC2QP.js.map} +0 -0
- /package/dist/{chunk-4KF5I3H5.js.map → chunk-ZD7PKYC4.js.map} +0 -0
- /package/dist/{chunk-ANCI6T7S.js.map → chunk-ZEQYHEWP.js.map} +0 -0
- /package/dist/{chunk-GKA5LFYR.js.map → chunk-ZP3QCPYG.js.map} +0 -0
- /package/dist/{chunk-6Y3EFN4Q.js.map → chunk-ZRVUCTSI.js.map} +0 -0
- /package/dist/{chunk-UJ4DLPYG.js.map → chunk-ZSI3ITRK.js.map} +0 -0
- /package/dist/{chunk-S44ADSZG.js.map → chunk-ZZMEQCIZ.js.map} +0 -0
- /package/dist/{computer-viewer-KLRAA56S.js.map → computer-viewer-ZBY3BPYW.js.map} +0 -0
- /package/dist/{connection-step-up-PWIIW3KK.js.map → connection-step-up-JQ4OFSQN.js.map} +0 -0
- /package/dist/{embedded-new-voice-P2RCFI3X.js.map → embedded-new-voice-ZB5XLKLU.js.map} +0 -0
- /package/dist/{embedded-voice-HY5F4D2I.js.map → embedded-voice-MZJISDCS.js.map} +0 -0
- /package/dist/{fleet-decision-row-UEXT7NAN.js.map → fleet-decision-row-LG3SYVR3.js.map} +0 -0
- /package/dist/{model-policy-picker-menu-AAGNLTEG.js.map → model-policy-picker-menu-5Y72PLNF.js.map} +0 -0
- /package/dist/{payment-page-card-MHTYJHCW.js.map → payment-page-card-YPSXRHBA.js.map} +0 -0
- /package/dist/{platform-activity-row-7VAPGRZQ.js.map → platform-activity-row-ZU4MEBNK.js.map} +0 -0
- /package/dist/{queue-surface-implementation-AE5P3PSA.js.map → queue-surface-implementation-6Q25RPH6.js.map} +0 -0
- /package/dist/{recorder-host-I53BQIRX.js.map → recorder-host-JD4GWJ2Z.js.map} +0 -0
- /package/dist/{sandbox-files-LGE7EDX2.js.map → sandbox-files-HCLEEJMU.js.map} +0 -0
- /package/dist/{session-connect-cards-QNL7WRKJ.js.map → session-connect-cards-DRKEN3Z4.js.map} +0 -0
- /package/dist/{session-realtime-ZMXMK5EV.js.map → session-realtime-IZOTTRH6.js.map} +0 -0
- /package/dist/{timeline-annotation-markers-5RICTVVW.js.map → timeline-annotation-markers-WWXNJOXI.js.map} +0 -0
- /package/dist/{timeline-annotation-selection-ITAHBOFW.js.map → timeline-annotation-selection-ZKRIQFIQ.js.map} +0 -0
- /package/dist/{timeline-annotations-dialog-7PGBTPVD.js.map → timeline-annotations-dialog-4IMKTOXJ.js.map} +0 -0
package/dist/chunk-TLR2SX7T.js
DELETED
|
@@ -1,2317 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import {
|
|
3
|
-
useLatestTaskRunner
|
|
4
|
-
} from "./chunk-2DDJ6YH6.js";
|
|
5
|
-
import {
|
|
6
|
-
ArtifactSubmissionProvider,
|
|
7
|
-
ArtifactSurface,
|
|
8
|
-
EditableArtifactDownloadButton,
|
|
9
|
-
EditableArtifactMessage,
|
|
10
|
-
artifactSubmissionSessionKey,
|
|
11
|
-
asEditableArtifactError,
|
|
12
|
-
editableArtifactAccessRevoked,
|
|
13
|
-
editableArtifactProjectionKey,
|
|
14
|
-
editableArtifactStatusLabel,
|
|
15
|
-
useArtifactSubmissions,
|
|
16
|
-
useEditableArtifactView
|
|
17
|
-
} from "./chunk-T2NC7ALH.js";
|
|
18
|
-
import {
|
|
19
|
-
cn
|
|
20
|
-
} from "./chunk-TXS65BB2.js";
|
|
21
|
-
import {
|
|
22
|
-
useOpenGeniText
|
|
23
|
-
} from "./chunk-DMDJPQCR.js";
|
|
24
|
-
|
|
25
|
-
// src/components/artifacts/document-editor.tsx
|
|
26
|
-
import {
|
|
27
|
-
BoldIcon,
|
|
28
|
-
Columns2Icon,
|
|
29
|
-
ItalicIcon,
|
|
30
|
-
MessageSquareTextIcon,
|
|
31
|
-
PilcrowIcon,
|
|
32
|
-
Rows3Icon,
|
|
33
|
-
UnderlineIcon
|
|
34
|
-
} from "lucide-react";
|
|
35
|
-
import {
|
|
36
|
-
memo,
|
|
37
|
-
useCallback,
|
|
38
|
-
useEffect,
|
|
39
|
-
useLayoutEffect,
|
|
40
|
-
useMemo,
|
|
41
|
-
useRef,
|
|
42
|
-
useState
|
|
43
|
-
} from "react";
|
|
44
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
45
|
-
var POINT_TO_CSS_PIXEL = 4 / 3;
|
|
46
|
-
var DEFAULT_VIEWPORT_HEIGHT = 640;
|
|
47
|
-
var RESPONSIVE_CONTINUOUS_LAYOUT_WIDTH = 640;
|
|
48
|
-
var PAGINATED_GAP = 24;
|
|
49
|
-
var CONTINUOUS_GAP = 1;
|
|
50
|
-
var MAX_PLAIN_TEXT_TRANSFER = 1e6;
|
|
51
|
-
var MAX_PROJECTION_BLOCKS = 1e5;
|
|
52
|
-
var MAX_PROJECTION_TABLE_CELLS = 1e6;
|
|
53
|
-
var MAX_PROJECTION_ANNOTATIONS = 1e5;
|
|
54
|
-
var MAX_PROJECTION_TEXT = 1e6;
|
|
55
|
-
var EMPTY_COMMENTS = [];
|
|
56
|
-
var EMPTY_CHANGES = [];
|
|
57
|
-
function DocumentEditor(props) {
|
|
58
|
-
return /* @__PURE__ */ jsx(DocumentEditorCore, { ...props, document: asDocumentView(props.document) });
|
|
59
|
-
}
|
|
60
|
-
function DocumentProjectionEditor({
|
|
61
|
-
projection,
|
|
62
|
-
commit,
|
|
63
|
-
onCommandError,
|
|
64
|
-
onSelectionChange,
|
|
65
|
-
readOnly = false,
|
|
66
|
-
...props
|
|
67
|
-
}) {
|
|
68
|
-
const view = useMemo(() => documentViewFromProjection(projection), [projection]);
|
|
69
|
-
return /* @__PURE__ */ jsx(
|
|
70
|
-
DocumentEditorCore,
|
|
71
|
-
{
|
|
72
|
-
...props,
|
|
73
|
-
document: view.document,
|
|
74
|
-
revisionToken: projection.revision,
|
|
75
|
-
readOnly: readOnly || !commit,
|
|
76
|
-
onCommandError,
|
|
77
|
-
blockIdForView: (blockId) => view.externalIdByInternal.get(blockId) ?? blockId,
|
|
78
|
-
onSelectionChange: (selection) => onSelectionChange?.({
|
|
79
|
-
...selection,
|
|
80
|
-
blockId: view.externalIdByInternal.get(selection.blockId) ?? selection.blockId
|
|
81
|
-
}),
|
|
82
|
-
onCommit: (command) => commit?.(mapDocumentCommit(command, view.externalIdByInternal))
|
|
83
|
-
}
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
function DocumentEditorCore({
|
|
87
|
-
document: document2,
|
|
88
|
-
revisionToken,
|
|
89
|
-
layout: controlledLayout,
|
|
90
|
-
defaultLayout,
|
|
91
|
-
onLayoutChange,
|
|
92
|
-
onSelectionChange,
|
|
93
|
-
onCommit,
|
|
94
|
-
onCommandError,
|
|
95
|
-
blockIdForView = identity,
|
|
96
|
-
readOnly = false,
|
|
97
|
-
ariaLabel: ariaLabelProp,
|
|
98
|
-
viewportHeight = DEFAULT_VIEWPORT_HEIGHT,
|
|
99
|
-
overscanPages = 1,
|
|
100
|
-
className
|
|
101
|
-
}) {
|
|
102
|
-
const t = useOpenGeniText();
|
|
103
|
-
const ariaLabel = ariaLabelProp === void 0 ? t("artifacts.documentEditor.documentEditor") : ariaLabelProp;
|
|
104
|
-
const [uncontrolledLayout, setUncontrolledLayout] = useState(
|
|
105
|
-
defaultLayout ?? "paginated"
|
|
106
|
-
);
|
|
107
|
-
const [scrollTop, setScrollTop] = useState(0);
|
|
108
|
-
const [measuredViewport, setMeasuredViewport] = useState({ width: 0, height: 0 });
|
|
109
|
-
const [localRevision, setLocalRevision] = useState(document2.revision);
|
|
110
|
-
const [measuredPageHeights, setMeasuredPageHeights] = useState(
|
|
111
|
-
() => /* @__PURE__ */ new Map()
|
|
112
|
-
);
|
|
113
|
-
const [selectedBlockId, setSelectedBlockId] = useState(null);
|
|
114
|
-
const [hasTextSelection, setHasTextSelection] = useState(false);
|
|
115
|
-
const selectionRef = useRef(null);
|
|
116
|
-
const [openThreadId, setOpenThreadId] = useState(null);
|
|
117
|
-
const [pendingCommands, setPendingCommands] = useState(0);
|
|
118
|
-
const [commandFailure, setCommandFailure] = useState(null);
|
|
119
|
-
const editorNodes = useRef(/* @__PURE__ */ new Map());
|
|
120
|
-
const viewportRef = useRef(null);
|
|
121
|
-
const pendingScrollTop = useRef(0);
|
|
122
|
-
const scrollFrame = useRef(null);
|
|
123
|
-
const pendingMeasurementAnchor = useRef(null);
|
|
124
|
-
const responsiveLayoutInitialized = useRef(false);
|
|
125
|
-
const measuredPageHeightsRef = useRef(/* @__PURE__ */ new Map());
|
|
126
|
-
const mountedRef = useRef(true);
|
|
127
|
-
const commandScopeRef = useRef(0);
|
|
128
|
-
const commandVersionsRef = useRef(/* @__PURE__ */ new Map());
|
|
129
|
-
const layout = controlledLayout ?? uncontrolledLayout;
|
|
130
|
-
const documentRevision = revisionToken ?? document2.revision;
|
|
131
|
-
const pageGap = layout === "paginated" ? PAGINATED_GAP : CONTINUOUS_GAP;
|
|
132
|
-
const basePages = useMemo(
|
|
133
|
-
() => projectPages(document2, layout),
|
|
134
|
-
// The revision values intentionally invalidate projections over the mutable public model.
|
|
135
|
-
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
136
|
-
[document2, documentRevision, layout, localRevision]
|
|
137
|
-
);
|
|
138
|
-
const naturalPages = useMemo(
|
|
139
|
-
() => basePages.map((page) => ({
|
|
140
|
-
...page,
|
|
141
|
-
// Estimates seed unmounted pages only. Once mounted, intrinsic content
|
|
142
|
-
// may correct the page in either direction while preserving paper size.
|
|
143
|
-
height: measuredPageHeights.has(page.key) ? Math.max(page.minimumHeight, measuredPageHeights.get(page.key) ?? page.height) : page.height
|
|
144
|
-
})),
|
|
145
|
-
[basePages, measuredPageHeights]
|
|
146
|
-
);
|
|
147
|
-
const pages = useMemo(
|
|
148
|
-
() => naturalPages.map((page) => {
|
|
149
|
-
const renderScale = layout === "paginated" ? responsiveDocumentPageScale(page.page, measuredViewport.width) : 1;
|
|
150
|
-
return {
|
|
151
|
-
...page,
|
|
152
|
-
naturalHeight: page.height,
|
|
153
|
-
renderScale,
|
|
154
|
-
height: page.height * renderScale,
|
|
155
|
-
minimumHeight: page.minimumHeight * renderScale
|
|
156
|
-
};
|
|
157
|
-
}),
|
|
158
|
-
[layout, measuredViewport.width, naturalPages]
|
|
159
|
-
);
|
|
160
|
-
const annotations = useMemo(
|
|
161
|
-
() => indexAnnotations(document2),
|
|
162
|
-
// The revision values intentionally invalidate indexes over the mutable public model.
|
|
163
|
-
// oxlint-disable-next-line react-hooks/exhaustive-deps
|
|
164
|
-
[document2, documentRevision, localRevision]
|
|
165
|
-
);
|
|
166
|
-
const axis = useMemo(() => buildPageAxis(pages, pageGap), [pages, pageGap]);
|
|
167
|
-
const pagesRef = useRef(pages);
|
|
168
|
-
const axisRef = useRef(axis);
|
|
169
|
-
pagesRef.current = pages;
|
|
170
|
-
axisRef.current = axis;
|
|
171
|
-
const blockPageIndex = useMemo(() => {
|
|
172
|
-
const index = /* @__PURE__ */ new Map();
|
|
173
|
-
pages.forEach((page, pageIndex) => {
|
|
174
|
-
for (const { block } of page.blocks) index.set(block.id, pageIndex);
|
|
175
|
-
});
|
|
176
|
-
return index;
|
|
177
|
-
}, [pages]);
|
|
178
|
-
const activePage = selectedBlockId ? blockPageIndex.get(selectedBlockId) ?? -1 : -1;
|
|
179
|
-
const mountedIndexes = useMemo(
|
|
180
|
-
() => visiblePageIndexes(
|
|
181
|
-
axis,
|
|
182
|
-
pages.length,
|
|
183
|
-
scrollTop,
|
|
184
|
-
Math.max(1, measuredViewport.height || viewportHeight),
|
|
185
|
-
Math.max(0, Math.floor(overscanPages)),
|
|
186
|
-
activePage
|
|
187
|
-
),
|
|
188
|
-
[
|
|
189
|
-
activePage,
|
|
190
|
-
axis,
|
|
191
|
-
measuredViewport.height,
|
|
192
|
-
overscanPages,
|
|
193
|
-
pages.length,
|
|
194
|
-
scrollTop,
|
|
195
|
-
viewportHeight
|
|
196
|
-
]
|
|
197
|
-
);
|
|
198
|
-
useLayoutEffect(() => {
|
|
199
|
-
const element = viewportRef.current;
|
|
200
|
-
if (!element) return;
|
|
201
|
-
const measure = () => {
|
|
202
|
-
const width = element.clientWidth;
|
|
203
|
-
const height = element.clientHeight;
|
|
204
|
-
if (width <= 0 && height <= 0) return;
|
|
205
|
-
setMeasuredViewport(
|
|
206
|
-
(current) => current.width === width && current.height === height ? current : { width, height }
|
|
207
|
-
);
|
|
208
|
-
};
|
|
209
|
-
measure();
|
|
210
|
-
const observer = globalThis.ResizeObserver ? new globalThis.ResizeObserver(measure) : null;
|
|
211
|
-
observer?.observe(element);
|
|
212
|
-
globalThis.addEventListener?.("resize", measure);
|
|
213
|
-
return () => {
|
|
214
|
-
observer?.disconnect();
|
|
215
|
-
globalThis.removeEventListener?.("resize", measure);
|
|
216
|
-
};
|
|
217
|
-
}, []);
|
|
218
|
-
useLayoutEffect(() => {
|
|
219
|
-
if (responsiveLayoutInitialized.current || controlledLayout !== void 0 || defaultLayout !== void 0 || measuredViewport.width <= 0) {
|
|
220
|
-
return;
|
|
221
|
-
}
|
|
222
|
-
responsiveLayoutInitialized.current = true;
|
|
223
|
-
if (measuredViewport.width < RESPONSIVE_CONTINUOUS_LAYOUT_WIDTH) {
|
|
224
|
-
setUncontrolledLayout("continuous");
|
|
225
|
-
onLayoutChange?.("continuous");
|
|
226
|
-
}
|
|
227
|
-
}, [controlledLayout, defaultLayout, measuredViewport.width, onLayoutChange]);
|
|
228
|
-
useEffect(() => {
|
|
229
|
-
commandScopeRef.current += 1;
|
|
230
|
-
commandVersionsRef.current.clear();
|
|
231
|
-
selectionRef.current = null;
|
|
232
|
-
setSelectedBlockId(null);
|
|
233
|
-
setHasTextSelection(false);
|
|
234
|
-
setOpenThreadId(null);
|
|
235
|
-
setLocalRevision(document2.revision);
|
|
236
|
-
setPendingCommands(0);
|
|
237
|
-
setCommandFailure(null);
|
|
238
|
-
}, [document2, revisionToken]);
|
|
239
|
-
useEffect(() => {
|
|
240
|
-
mountedRef.current = true;
|
|
241
|
-
return () => {
|
|
242
|
-
mountedRef.current = false;
|
|
243
|
-
if (scrollFrame.current !== null && globalThis.cancelAnimationFrame) {
|
|
244
|
-
globalThis.cancelAnimationFrame(scrollFrame.current);
|
|
245
|
-
}
|
|
246
|
-
};
|
|
247
|
-
}, []);
|
|
248
|
-
const handleScroll = useCallback((event) => {
|
|
249
|
-
pendingScrollTop.current = event.currentTarget.scrollTop;
|
|
250
|
-
if (scrollFrame.current !== null) return;
|
|
251
|
-
if (!globalThis.requestAnimationFrame) {
|
|
252
|
-
scrollFrame.current = -1;
|
|
253
|
-
queueMicrotask(() => {
|
|
254
|
-
scrollFrame.current = null;
|
|
255
|
-
setScrollTop(pendingScrollTop.current);
|
|
256
|
-
});
|
|
257
|
-
return;
|
|
258
|
-
}
|
|
259
|
-
scrollFrame.current = globalThis.requestAnimationFrame(() => {
|
|
260
|
-
scrollFrame.current = null;
|
|
261
|
-
setScrollTop(pendingScrollTop.current);
|
|
262
|
-
});
|
|
263
|
-
}, []);
|
|
264
|
-
const clearSelection = useCallback(() => {
|
|
265
|
-
selectionRef.current = null;
|
|
266
|
-
setSelectedBlockId(null);
|
|
267
|
-
setHasTextSelection(false);
|
|
268
|
-
}, []);
|
|
269
|
-
const recordPageHeight = useCallback((key, height) => {
|
|
270
|
-
if (!Number.isFinite(height) || height <= 0) return;
|
|
271
|
-
const rounded = Math.ceil(height);
|
|
272
|
-
const current = measuredPageHeightsRef.current;
|
|
273
|
-
if (Math.abs((current.get(key) ?? 0) - rounded) <= 1) return;
|
|
274
|
-
const currentPages = pagesRef.current;
|
|
275
|
-
if (!currentPages.some((page) => page.key === key)) return;
|
|
276
|
-
const viewport = viewportRef.current;
|
|
277
|
-
if (viewport && pendingMeasurementAnchor.current === null) {
|
|
278
|
-
const currentAxis = axisRef.current;
|
|
279
|
-
const anchorIndex = pageAtOffset(currentAxis, currentPages.length, viewport.scrollTop);
|
|
280
|
-
const anchorPage = currentPages[anchorIndex];
|
|
281
|
-
if (anchorPage) {
|
|
282
|
-
pendingMeasurementAnchor.current = {
|
|
283
|
-
axis: currentAxis,
|
|
284
|
-
key: anchorPage.key,
|
|
285
|
-
offset: viewport.scrollTop - currentAxis.offsets[anchorIndex],
|
|
286
|
-
scrollTop: viewport.scrollTop
|
|
287
|
-
};
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
const next = /* @__PURE__ */ new Map();
|
|
291
|
-
for (const page of currentPages) {
|
|
292
|
-
const measured = current.get(page.key);
|
|
293
|
-
if (measured !== void 0) next.set(page.key, measured);
|
|
294
|
-
}
|
|
295
|
-
next.set(key, rounded);
|
|
296
|
-
measuredPageHeightsRef.current = next;
|
|
297
|
-
setMeasuredPageHeights(next);
|
|
298
|
-
}, []);
|
|
299
|
-
useLayoutEffect(() => {
|
|
300
|
-
const anchor = pendingMeasurementAnchor.current;
|
|
301
|
-
if (!anchor || anchor.axis === axis) return;
|
|
302
|
-
pendingMeasurementAnchor.current = null;
|
|
303
|
-
const viewport = viewportRef.current;
|
|
304
|
-
if (!viewport || Math.abs(viewport.scrollTop - anchor.scrollTop) > 1) return;
|
|
305
|
-
const anchorIndex = pages.findIndex((page) => page.key === anchor.key);
|
|
306
|
-
if (anchorIndex < 0) return;
|
|
307
|
-
const nextScrollTop = Math.max(0, axis.offsets[anchorIndex] + anchor.offset);
|
|
308
|
-
if (Math.abs(viewport.scrollTop - nextScrollTop) > 0.5) {
|
|
309
|
-
viewport.scrollTop = nextScrollTop;
|
|
310
|
-
}
|
|
311
|
-
const correctedScrollTop = viewport.scrollTop;
|
|
312
|
-
pendingScrollTop.current = correctedScrollTop;
|
|
313
|
-
setScrollTop(
|
|
314
|
-
(current) => Math.abs(current - correctedScrollTop) > 0.5 ? correctedScrollTop : current
|
|
315
|
-
);
|
|
316
|
-
}, [axis, pages]);
|
|
317
|
-
const publishSelection = useCallback(
|
|
318
|
-
(next) => {
|
|
319
|
-
selectionRef.current = next;
|
|
320
|
-
setSelectedBlockId((current) => current === next.blockId ? current : next.blockId);
|
|
321
|
-
const nextHasTextSelection = next.end > next.start;
|
|
322
|
-
setHasTextSelection(
|
|
323
|
-
(current) => current === nextHasTextSelection ? current : nextHasTextSelection
|
|
324
|
-
);
|
|
325
|
-
onSelectionChange?.(next);
|
|
326
|
-
},
|
|
327
|
-
[onSelectionChange]
|
|
328
|
-
);
|
|
329
|
-
const readDomSelection = useCallback(
|
|
330
|
-
(blockId) => {
|
|
331
|
-
const node = editorNodes.current.get(blockId);
|
|
332
|
-
const offsets = node ? selectionOffsets(node) : null;
|
|
333
|
-
const next = {
|
|
334
|
-
blockId,
|
|
335
|
-
start: offsets?.start ?? 0,
|
|
336
|
-
end: offsets?.end ?? 0
|
|
337
|
-
};
|
|
338
|
-
publishSelection(next);
|
|
339
|
-
return next;
|
|
340
|
-
},
|
|
341
|
-
[publishSelection]
|
|
342
|
-
);
|
|
343
|
-
const runCommit = useCallback(
|
|
344
|
-
(command) => {
|
|
345
|
-
if (!onCommit) return;
|
|
346
|
-
const scope = commandScopeRef.current;
|
|
347
|
-
const submit = () => {
|
|
348
|
-
const key = command.blockId;
|
|
349
|
-
const version = (commandVersionsRef.current.get(key) ?? 0) + 1;
|
|
350
|
-
commandVersionsRef.current.set(key, version);
|
|
351
|
-
setCommandFailure(null);
|
|
352
|
-
const fail = (cause) => {
|
|
353
|
-
if (!mountedRef.current || commandScopeRef.current !== scope || commandVersionsRef.current.get(key) !== version) {
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
const error = asDocumentError(cause);
|
|
357
|
-
setCommandFailure({ message: error.message, retry: submit });
|
|
358
|
-
onCommandError?.(error);
|
|
359
|
-
};
|
|
360
|
-
let result;
|
|
361
|
-
try {
|
|
362
|
-
result = onCommit(command);
|
|
363
|
-
} catch (cause) {
|
|
364
|
-
fail(cause);
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
if (!result || typeof result.then !== "function") return;
|
|
368
|
-
setPendingCommands((current) => current + 1);
|
|
369
|
-
void Promise.resolve(result).then(
|
|
370
|
-
() => {
|
|
371
|
-
if (!mountedRef.current || commandScopeRef.current !== scope) return;
|
|
372
|
-
setPendingCommands((current) => Math.max(0, current - 1));
|
|
373
|
-
},
|
|
374
|
-
(cause) => {
|
|
375
|
-
if (!mountedRef.current || commandScopeRef.current !== scope) return;
|
|
376
|
-
setPendingCommands((current) => Math.max(0, current - 1));
|
|
377
|
-
fail(cause);
|
|
378
|
-
}
|
|
379
|
-
);
|
|
380
|
-
};
|
|
381
|
-
submit();
|
|
382
|
-
},
|
|
383
|
-
[onCommandError, onCommit]
|
|
384
|
-
);
|
|
385
|
-
const commitText = useCallback(
|
|
386
|
-
(paragraph, text) => {
|
|
387
|
-
if (readOnly || paragraph.text === text) return;
|
|
388
|
-
paragraph.text = text;
|
|
389
|
-
runCommit({
|
|
390
|
-
kind: "text",
|
|
391
|
-
blockId: paragraph.id,
|
|
392
|
-
text,
|
|
393
|
-
revision: revisionToken ?? document2.revision
|
|
394
|
-
});
|
|
395
|
-
},
|
|
396
|
-
[document2, readOnly, revisionToken, runCommit]
|
|
397
|
-
);
|
|
398
|
-
const applyFormat = useCallback(
|
|
399
|
-
(property) => {
|
|
400
|
-
const selection = selectionRef.current;
|
|
401
|
-
if (readOnly || !selection) return;
|
|
402
|
-
let block;
|
|
403
|
-
try {
|
|
404
|
-
block = document2.resolve(selection.blockId);
|
|
405
|
-
} catch {
|
|
406
|
-
clearSelection();
|
|
407
|
-
return;
|
|
408
|
-
}
|
|
409
|
-
if (!isDocumentParagraph(block)) return;
|
|
410
|
-
const node = editorNodes.current.get(block.id);
|
|
411
|
-
if (node) commitText(block, node.textContent ?? "");
|
|
412
|
-
const current = selectionOffsets(node) ?? selection;
|
|
413
|
-
const start = Math.max(0, Math.min(current.start, block.text.length));
|
|
414
|
-
const end = Math.max(start, Math.min(current.end, block.text.length));
|
|
415
|
-
if (end <= start) return;
|
|
416
|
-
const effectiveEnd = end;
|
|
417
|
-
const effectiveStart = start;
|
|
418
|
-
const style = toggledTextStyle(block, effectiveStart, effectiveEnd, property);
|
|
419
|
-
block.format({ start: effectiveStart, end: effectiveEnd, style });
|
|
420
|
-
runCommit({
|
|
421
|
-
kind: "format",
|
|
422
|
-
blockId: block.id,
|
|
423
|
-
range: { start: effectiveStart, end: effectiveEnd },
|
|
424
|
-
style,
|
|
425
|
-
revision: revisionToken ?? document2.revision
|
|
426
|
-
});
|
|
427
|
-
queueMicrotask(() => restoreSelection(editorNodes.current.get(block.id), start, end));
|
|
428
|
-
},
|
|
429
|
-
[clearSelection, commitText, document2, readOnly, revisionToken, runCommit]
|
|
430
|
-
);
|
|
431
|
-
const handleEditorKeyDown = useCallback(
|
|
432
|
-
(event, paragraph) => {
|
|
433
|
-
const modifier = event.metaKey || event.ctrlKey;
|
|
434
|
-
if (!modifier) return;
|
|
435
|
-
const key = event.key.toLowerCase();
|
|
436
|
-
if (key !== "b" && key !== "i" && key !== "u") return;
|
|
437
|
-
event.preventDefault();
|
|
438
|
-
const current = readDomSelection(paragraph.id);
|
|
439
|
-
selectionRef.current = current;
|
|
440
|
-
const property = key === "b" ? "bold" : key === "i" ? "italic" : "underline";
|
|
441
|
-
const start = current.start;
|
|
442
|
-
const end = current.end;
|
|
443
|
-
if (end <= start || readOnly) return;
|
|
444
|
-
const effectiveStart = start;
|
|
445
|
-
const effectiveEnd = end;
|
|
446
|
-
const style = toggledTextStyle(paragraph, effectiveStart, effectiveEnd, property);
|
|
447
|
-
paragraph.format({ start: effectiveStart, end: effectiveEnd, style });
|
|
448
|
-
runCommit({
|
|
449
|
-
kind: "format",
|
|
450
|
-
blockId: paragraph.id,
|
|
451
|
-
range: { start: effectiveStart, end: effectiveEnd },
|
|
452
|
-
style,
|
|
453
|
-
revision: revisionToken ?? document2.revision
|
|
454
|
-
});
|
|
455
|
-
queueMicrotask(() => restoreSelection(editorNodes.current.get(paragraph.id), start, end));
|
|
456
|
-
},
|
|
457
|
-
[document2, readDomSelection, readOnly, revisionToken, runCommit]
|
|
458
|
-
);
|
|
459
|
-
const changeLayout = (next) => {
|
|
460
|
-
if (controlledLayout === void 0) setUncontrolledLayout(next);
|
|
461
|
-
onLayoutChange?.(next);
|
|
462
|
-
};
|
|
463
|
-
const addFirstParagraph = () => {
|
|
464
|
-
if (readOnly) return;
|
|
465
|
-
const paragraph = document2.blocks.addParagraph("");
|
|
466
|
-
setLocalRevision(document2.revision);
|
|
467
|
-
publishSelection({ blockId: paragraph.id, start: 0, end: 0 });
|
|
468
|
-
runCommit({
|
|
469
|
-
kind: "insert-paragraph",
|
|
470
|
-
blockId: paragraph.id,
|
|
471
|
-
revision: revisionToken ?? document2.revision
|
|
472
|
-
});
|
|
473
|
-
};
|
|
474
|
-
return /* @__PURE__ */ jsxs(
|
|
475
|
-
"div",
|
|
476
|
-
{
|
|
477
|
-
"data-og-document-editor": "",
|
|
478
|
-
"data-og-document-layout": layout,
|
|
479
|
-
"data-og-command-state": commandFailure ? "error" : pendingCommands > 0 ? "pending" : "idle",
|
|
480
|
-
"aria-busy": pendingCommands > 0 ? "true" : void 0,
|
|
481
|
-
className: cn("flex h-full min-h-0 min-w-0 flex-col bg-og-surface-2", className),
|
|
482
|
-
children: [
|
|
483
|
-
/* @__PURE__ */ jsxs(
|
|
484
|
-
"div",
|
|
485
|
-
{
|
|
486
|
-
role: "toolbar",
|
|
487
|
-
"aria-label": t("artifacts.documentEditor.documentFormatting"),
|
|
488
|
-
className: "flex min-h-10 shrink-0 items-center gap-1 border-b border-og-border bg-og-surface-1 px-2",
|
|
489
|
-
children: [
|
|
490
|
-
/* @__PURE__ */ jsx(
|
|
491
|
-
ToolbarButton,
|
|
492
|
-
{
|
|
493
|
-
label: t("artifacts.documentEditor.bold"),
|
|
494
|
-
shortcut: "\u2318B",
|
|
495
|
-
disabled: readOnly || !selectedBlockId || !hasTextSelection,
|
|
496
|
-
onPress: () => applyFormat("bold"),
|
|
497
|
-
children: /* @__PURE__ */ jsx(BoldIcon, { className: "size-4" })
|
|
498
|
-
}
|
|
499
|
-
),
|
|
500
|
-
/* @__PURE__ */ jsx(
|
|
501
|
-
ToolbarButton,
|
|
502
|
-
{
|
|
503
|
-
label: t("artifacts.documentEditor.italic"),
|
|
504
|
-
shortcut: "\u2318I",
|
|
505
|
-
disabled: readOnly || !selectedBlockId || !hasTextSelection,
|
|
506
|
-
onPress: () => applyFormat("italic"),
|
|
507
|
-
children: /* @__PURE__ */ jsx(ItalicIcon, { className: "size-4" })
|
|
508
|
-
}
|
|
509
|
-
),
|
|
510
|
-
/* @__PURE__ */ jsx(
|
|
511
|
-
ToolbarButton,
|
|
512
|
-
{
|
|
513
|
-
label: t("artifacts.documentEditor.underline"),
|
|
514
|
-
shortcut: "\u2318U",
|
|
515
|
-
disabled: readOnly || !selectedBlockId || !hasTextSelection,
|
|
516
|
-
onPress: () => applyFormat("underline"),
|
|
517
|
-
children: /* @__PURE__ */ jsx(UnderlineIcon, { className: "size-4" })
|
|
518
|
-
}
|
|
519
|
-
),
|
|
520
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "mx-1 h-5 w-px bg-og-border" }),
|
|
521
|
-
/* @__PURE__ */ jsx(
|
|
522
|
-
ToolbarButton,
|
|
523
|
-
{
|
|
524
|
-
label: t("artifacts.documentEditor.continuousLayout"),
|
|
525
|
-
pressed: layout === "continuous",
|
|
526
|
-
onPress: () => changeLayout("continuous"),
|
|
527
|
-
children: /* @__PURE__ */ jsx(Rows3Icon, { className: "size-4" })
|
|
528
|
-
}
|
|
529
|
-
),
|
|
530
|
-
/* @__PURE__ */ jsx(
|
|
531
|
-
ToolbarButton,
|
|
532
|
-
{
|
|
533
|
-
label: t("artifacts.documentEditor.paginatedLayout"),
|
|
534
|
-
pressed: layout === "paginated",
|
|
535
|
-
onPress: () => changeLayout("paginated"),
|
|
536
|
-
children: /* @__PURE__ */ jsx(Columns2Icon, { className: "size-4" })
|
|
537
|
-
}
|
|
538
|
-
),
|
|
539
|
-
/* @__PURE__ */ jsxs("span", { className: "ml-auto truncate text-og-xs text-og-fg-muted", children: [
|
|
540
|
-
commandFailure ? t("artifacts.documentEditor.changeNotSaved") : pendingCommands > 0 ? t("artifacts.documentEditor.saving") : readOnly ? t("artifacts.documentEditor.readOnly") : t("artifacts.documentEditor.editing"),
|
|
541
|
-
" ",
|
|
542
|
-
t("artifacts.documentEditor.localestringBlocks", {
|
|
543
|
-
localeString: document2.blocks.items.length.toLocaleString(t.locale)
|
|
544
|
-
})
|
|
545
|
-
] })
|
|
546
|
-
]
|
|
547
|
-
}
|
|
548
|
-
),
|
|
549
|
-
/* @__PURE__ */ jsx("div", { role: "status", "aria-live": "polite", className: "sr-only", children: commandFailure?.message ?? (pendingCommands > 0 ? t("artifacts.documentEditor.savingDocumentChanges") : "") }),
|
|
550
|
-
/* @__PURE__ */ jsxs(
|
|
551
|
-
"div",
|
|
552
|
-
{
|
|
553
|
-
ref: viewportRef,
|
|
554
|
-
role: "document",
|
|
555
|
-
"aria-label": ariaLabel,
|
|
556
|
-
"aria-readonly": readOnly,
|
|
557
|
-
tabIndex: -1,
|
|
558
|
-
onPointerDown: (event) => {
|
|
559
|
-
const target = event.target;
|
|
560
|
-
if (target instanceof Element && !target.closest("[data-og-paragraph]")) {
|
|
561
|
-
clearSelection();
|
|
562
|
-
}
|
|
563
|
-
},
|
|
564
|
-
onScroll: handleScroll,
|
|
565
|
-
className: cn(
|
|
566
|
-
"relative min-h-0 min-w-0 flex-1 overflow-auto overscroll-contain outline-hidden [overflow-anchor:none]",
|
|
567
|
-
layout === "paginated" ? "bg-og-surface-3" : "bg-og-surface-1"
|
|
568
|
-
),
|
|
569
|
-
style: { height: Math.max(1, viewportHeight) },
|
|
570
|
-
children: [
|
|
571
|
-
commandFailure ? /* @__PURE__ */ jsxs(
|
|
572
|
-
"div",
|
|
573
|
-
{
|
|
574
|
-
role: "alert",
|
|
575
|
-
className: "absolute left-2 top-2 z-30 flex w-fit items-center gap-2 rounded-og-sm border border-og-status-failed/30 bg-og-surface-1/95 px-2 py-1 text-og-xs text-og-status-failed shadow-og-sm",
|
|
576
|
-
style: { maxWidth: "calc(100% - 1rem)" },
|
|
577
|
-
children: [
|
|
578
|
-
/* @__PURE__ */ jsx("span", { className: "truncate", children: commandFailure.message }),
|
|
579
|
-
/* @__PURE__ */ jsx(
|
|
580
|
-
"button",
|
|
581
|
-
{
|
|
582
|
-
type: "button",
|
|
583
|
-
onClick: commandFailure.retry,
|
|
584
|
-
className: "shrink-0 rounded-og-xs px-1.5 py-0.5 font-medium outline-hidden hover:bg-og-surface-3 focus-visible:ring-2 focus-visible:ring-og-accent",
|
|
585
|
-
children: t("artifacts.documentEditor.retry")
|
|
586
|
-
}
|
|
587
|
-
)
|
|
588
|
-
]
|
|
589
|
-
}
|
|
590
|
-
) : null,
|
|
591
|
-
pages.length === 0 ? /* @__PURE__ */ jsx("div", { className: "grid h-full place-items-center p-8 text-center", children: /* @__PURE__ */ jsxs("div", { children: [
|
|
592
|
-
/* @__PURE__ */ jsx(PilcrowIcon, { "aria-hidden": true, className: "mx-auto mb-3 size-7 text-og-fg-subtle" }),
|
|
593
|
-
/* @__PURE__ */ jsx("p", { className: "text-og-sm text-og-fg-muted", children: t("artifacts.documentEditor.thisDocumentIsEmpty") }),
|
|
594
|
-
!readOnly ? /* @__PURE__ */ jsx(
|
|
595
|
-
"button",
|
|
596
|
-
{
|
|
597
|
-
type: "button",
|
|
598
|
-
onClick: addFirstParagraph,
|
|
599
|
-
className: "mt-3 rounded-og-md border border-og-primary-border bg-og-primary px-3 py-1.5 text-og-sm text-og-primary-fg hover:bg-og-primary-hover focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-og-accent",
|
|
600
|
-
children: t("artifacts.documentEditor.startWriting")
|
|
601
|
-
}
|
|
602
|
-
) : null
|
|
603
|
-
] }) }) : /* @__PURE__ */ jsx(
|
|
604
|
-
"div",
|
|
605
|
-
{
|
|
606
|
-
className: "relative min-w-full",
|
|
607
|
-
style: {
|
|
608
|
-
height: axis.total,
|
|
609
|
-
minWidth: layout === "paginated" ? pages.reduce(
|
|
610
|
-
(width, page) => Math.max(
|
|
611
|
-
width,
|
|
612
|
-
page.page.widthPt * POINT_TO_CSS_PIXEL * page.renderScale + 32
|
|
613
|
-
),
|
|
614
|
-
0
|
|
615
|
-
) : void 0
|
|
616
|
-
},
|
|
617
|
-
children: mountedIndexes.map((pageIndex) => {
|
|
618
|
-
const page = pages[pageIndex];
|
|
619
|
-
const top = axis.offsets[pageIndex];
|
|
620
|
-
const pageWidth = page.page.widthPt * POINT_TO_CSS_PIXEL * page.renderScale;
|
|
621
|
-
return /* @__PURE__ */ jsx(
|
|
622
|
-
"article",
|
|
623
|
-
{
|
|
624
|
-
"aria-label": `${layout === "paginated" ? t("artifacts.documentEditor.page") : t("artifacts.documentEditor.section")} ${pageIndex + 1} of ${pages.length}`,
|
|
625
|
-
"aria-posinset": pageIndex + 1,
|
|
626
|
-
"aria-setsize": pages.length,
|
|
627
|
-
"data-og-document-page": pageIndex + 1,
|
|
628
|
-
"data-og-page-width-pt": page.page.widthPt,
|
|
629
|
-
"data-og-page-height-pt": page.page.heightPt,
|
|
630
|
-
className: cn(
|
|
631
|
-
"absolute overflow-hidden",
|
|
632
|
-
layout === "paginated" ? "border shadow-og-sm" : "left-0 right-0 border-b border-og-border bg-og-surface-1 text-og-fg"
|
|
633
|
-
),
|
|
634
|
-
style: {
|
|
635
|
-
top,
|
|
636
|
-
// Center against the visible viewport, not the shared width
|
|
637
|
-
// reserved for the widest section in this document.
|
|
638
|
-
left: layout === "paginated" ? Math.max(16, (measuredViewport.width - pageWidth) / 2) : void 0,
|
|
639
|
-
color: layout === "paginated" ? "#171717" : void 0,
|
|
640
|
-
backgroundColor: layout === "paginated" ? "#fff" : void 0,
|
|
641
|
-
borderColor: layout === "paginated" ? "#0000001a" : void 0,
|
|
642
|
-
width: layout === "paginated" ? pageWidth : void 0,
|
|
643
|
-
height: page.height,
|
|
644
|
-
containerType: layout === "continuous" ? "inline-size" : void 0
|
|
645
|
-
},
|
|
646
|
-
children: /* @__PURE__ */ jsx(
|
|
647
|
-
MeasuredPageBody,
|
|
648
|
-
{
|
|
649
|
-
pageKey: page.key,
|
|
650
|
-
measureToken: documentRevision,
|
|
651
|
-
onHeight: recordPageHeight,
|
|
652
|
-
className: cn(
|
|
653
|
-
layout === "paginated" ? "absolute left-0 top-0 overflow-hidden" : "mx-auto"
|
|
654
|
-
),
|
|
655
|
-
style: {
|
|
656
|
-
...pageContentStyle(page.page, layout),
|
|
657
|
-
maxWidth: layout === "continuous" ? "68rem" : void 0,
|
|
658
|
-
...layout === "paginated" ? {
|
|
659
|
-
width: page.page.widthPt * POINT_TO_CSS_PIXEL,
|
|
660
|
-
minHeight: page.naturalHeight,
|
|
661
|
-
transform: `scale(${page.renderScale})`,
|
|
662
|
-
transformOrigin: "top left"
|
|
663
|
-
} : {}
|
|
664
|
-
},
|
|
665
|
-
children: page.blocks.map(({ block, listOrdinal }) => /* @__PURE__ */ jsx(
|
|
666
|
-
DocumentBlockView,
|
|
667
|
-
{
|
|
668
|
-
block,
|
|
669
|
-
viewBlockId: blockIdForView(block.id),
|
|
670
|
-
comments: annotations.comments.get(block.id) ?? EMPTY_COMMENTS,
|
|
671
|
-
changes: annotations.changes.get(block.id) ?? EMPTY_CHANGES,
|
|
672
|
-
projectionRevision: localRevision,
|
|
673
|
-
listOrdinal,
|
|
674
|
-
readOnly,
|
|
675
|
-
selected: selectedBlockId === block.id,
|
|
676
|
-
openThreadId,
|
|
677
|
-
registerEditor: (node) => {
|
|
678
|
-
if (node) editorNodes.current.set(block.id, node);
|
|
679
|
-
else editorNodes.current.delete(block.id);
|
|
680
|
-
},
|
|
681
|
-
onThreadToggle: (threadId) => setOpenThreadId((current) => current === threadId ? null : threadId),
|
|
682
|
-
onInput: (paragraph, text) => commitText(paragraph, text),
|
|
683
|
-
onBlur: () => setLocalRevision(document2.revision),
|
|
684
|
-
onSelection: (paragraph) => readDomSelection(paragraph.id),
|
|
685
|
-
onKeyDown: handleEditorKeyDown
|
|
686
|
-
},
|
|
687
|
-
block.id
|
|
688
|
-
))
|
|
689
|
-
}
|
|
690
|
-
)
|
|
691
|
-
},
|
|
692
|
-
page.key
|
|
693
|
-
);
|
|
694
|
-
})
|
|
695
|
-
}
|
|
696
|
-
)
|
|
697
|
-
]
|
|
698
|
-
}
|
|
699
|
-
)
|
|
700
|
-
]
|
|
701
|
-
}
|
|
702
|
-
);
|
|
703
|
-
}
|
|
704
|
-
function DocumentArtifactSurface({
|
|
705
|
-
document: document2,
|
|
706
|
-
title,
|
|
707
|
-
showHeader,
|
|
708
|
-
subtitle,
|
|
709
|
-
busy,
|
|
710
|
-
className,
|
|
711
|
-
editorClassName,
|
|
712
|
-
...editorProps
|
|
713
|
-
}) {
|
|
714
|
-
const t = useOpenGeniText();
|
|
715
|
-
return /* @__PURE__ */ jsx(
|
|
716
|
-
ArtifactSurface,
|
|
717
|
-
{
|
|
718
|
-
modality: "document",
|
|
719
|
-
title,
|
|
720
|
-
showHeader,
|
|
721
|
-
subtitle,
|
|
722
|
-
busy,
|
|
723
|
-
className,
|
|
724
|
-
children: /* @__PURE__ */ jsx(
|
|
725
|
-
DocumentEditor,
|
|
726
|
-
{
|
|
727
|
-
...editorProps,
|
|
728
|
-
document: document2,
|
|
729
|
-
ariaLabel: t("artifacts.documentEditor.titleDocument", { title }),
|
|
730
|
-
className: editorClassName
|
|
731
|
-
}
|
|
732
|
-
)
|
|
733
|
-
}
|
|
734
|
-
);
|
|
735
|
-
}
|
|
736
|
-
function DocumentProjectionArtifactSurface({
|
|
737
|
-
projection,
|
|
738
|
-
title,
|
|
739
|
-
showHeader,
|
|
740
|
-
subtitle,
|
|
741
|
-
actions,
|
|
742
|
-
busy,
|
|
743
|
-
className,
|
|
744
|
-
editorClassName,
|
|
745
|
-
...editorProps
|
|
746
|
-
}) {
|
|
747
|
-
const t = useOpenGeniText();
|
|
748
|
-
return /* @__PURE__ */ jsx(
|
|
749
|
-
ArtifactSurface,
|
|
750
|
-
{
|
|
751
|
-
modality: "document",
|
|
752
|
-
title,
|
|
753
|
-
showHeader,
|
|
754
|
-
subtitle,
|
|
755
|
-
actions,
|
|
756
|
-
busy,
|
|
757
|
-
className,
|
|
758
|
-
children: /* @__PURE__ */ jsx(
|
|
759
|
-
DocumentProjectionEditor,
|
|
760
|
-
{
|
|
761
|
-
...editorProps,
|
|
762
|
-
projection,
|
|
763
|
-
ariaLabel: t("artifacts.documentEditor.titleDocument", { title }),
|
|
764
|
-
className: editorClassName
|
|
765
|
-
}
|
|
766
|
-
)
|
|
767
|
-
}
|
|
768
|
-
);
|
|
769
|
-
}
|
|
770
|
-
function MeasuredPageBody({
|
|
771
|
-
pageKey,
|
|
772
|
-
measureToken,
|
|
773
|
-
onHeight,
|
|
774
|
-
className,
|
|
775
|
-
style,
|
|
776
|
-
children
|
|
777
|
-
}) {
|
|
778
|
-
const nodeRef = useRef(null);
|
|
779
|
-
useLayoutEffect(() => {
|
|
780
|
-
const node = nodeRef.current;
|
|
781
|
-
if (!node) return;
|
|
782
|
-
const report = () => onHeight(pageKey, Math.max(node.clientHeight, node.scrollHeight));
|
|
783
|
-
report();
|
|
784
|
-
if (!globalThis.ResizeObserver) return;
|
|
785
|
-
const observer = new globalThis.ResizeObserver(report);
|
|
786
|
-
observer.observe(node);
|
|
787
|
-
return () => observer.disconnect();
|
|
788
|
-
}, [measureToken, onHeight, pageKey]);
|
|
789
|
-
return /* @__PURE__ */ jsx("div", { ref: nodeRef, className, style, children });
|
|
790
|
-
}
|
|
791
|
-
function DocumentBlockView({
|
|
792
|
-
block,
|
|
793
|
-
viewBlockId,
|
|
794
|
-
comments,
|
|
795
|
-
changes,
|
|
796
|
-
projectionRevision,
|
|
797
|
-
listOrdinal,
|
|
798
|
-
readOnly,
|
|
799
|
-
selected,
|
|
800
|
-
openThreadId,
|
|
801
|
-
registerEditor,
|
|
802
|
-
onThreadToggle,
|
|
803
|
-
onInput,
|
|
804
|
-
onBlur,
|
|
805
|
-
onSelection,
|
|
806
|
-
onKeyDown
|
|
807
|
-
}) {
|
|
808
|
-
const t = useOpenGeniText();
|
|
809
|
-
if (isDocumentTable(block)) {
|
|
810
|
-
return /* @__PURE__ */ jsx(DocumentTableView, { table: block, viewBlockId });
|
|
811
|
-
}
|
|
812
|
-
const unresolved = comments.filter((thread) => !thread.resolved);
|
|
813
|
-
const commentPanelOpen = comments.some((thread) => thread.id === openThreadId);
|
|
814
|
-
const paragraphStyle = toParagraphStyle(block);
|
|
815
|
-
const segments = annotateRuns(block, unresolved, changes);
|
|
816
|
-
const marker = block.style.list ? block.style.list.kind === "number" ? `${listOrdinal ?? 1}.` : "\u2022" : null;
|
|
817
|
-
return /* @__PURE__ */ jsxs(
|
|
818
|
-
"div",
|
|
819
|
-
{
|
|
820
|
-
"data-og-document-block": viewBlockId,
|
|
821
|
-
"data-og-block-kind": "paragraph",
|
|
822
|
-
className: cn(
|
|
823
|
-
"group relative flex min-h-7 min-w-0 gap-2 rounded-sm px-1 transition-colors",
|
|
824
|
-
selected && "bg-og-accent-soft ring-1 ring-inset ring-og-accent"
|
|
825
|
-
),
|
|
826
|
-
children: [
|
|
827
|
-
marker ? /* @__PURE__ */ jsx(
|
|
828
|
-
"span",
|
|
829
|
-
{
|
|
830
|
-
"aria-hidden": true,
|
|
831
|
-
className: "w-7 shrink-0 select-none text-right opacity-70",
|
|
832
|
-
style: {
|
|
833
|
-
paddingLeft: `${(block.style.list?.level ?? 0) * 12}px`,
|
|
834
|
-
paddingTop: "0.1em"
|
|
835
|
-
},
|
|
836
|
-
children: marker
|
|
837
|
-
}
|
|
838
|
-
) : null,
|
|
839
|
-
/* @__PURE__ */ jsx(
|
|
840
|
-
ParagraphLeaf,
|
|
841
|
-
{
|
|
842
|
-
paragraph: block,
|
|
843
|
-
viewBlockId,
|
|
844
|
-
segments,
|
|
845
|
-
paragraphStyle,
|
|
846
|
-
listOrdinal,
|
|
847
|
-
readOnly,
|
|
848
|
-
registerEditor,
|
|
849
|
-
onInput,
|
|
850
|
-
onBlur,
|
|
851
|
-
onSelection,
|
|
852
|
-
onKeyDown
|
|
853
|
-
},
|
|
854
|
-
`${block.id}:${projectionRevision}`
|
|
855
|
-
),
|
|
856
|
-
comments.length > 0 || changes.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "relative flex w-7 shrink-0 flex-col items-center gap-1 pt-0.5", children: [
|
|
857
|
-
comments.length > 0 ? /* @__PURE__ */ jsx(
|
|
858
|
-
"button",
|
|
859
|
-
{
|
|
860
|
-
type: "button",
|
|
861
|
-
"aria-label": unresolved.length > 0 ? t("artifacts.documentEditor.unresolvedComments", { count: unresolved.length }) : t("artifacts.documentEditor.resolvedComments", { count: comments.length }),
|
|
862
|
-
"aria-expanded": commentPanelOpen,
|
|
863
|
-
onClick: () => onThreadToggle((unresolved[0] ?? comments[0]).id),
|
|
864
|
-
className: cn(
|
|
865
|
-
"grid size-6 place-items-center rounded-full focus-visible:outline-hidden focus-visible:ring-2",
|
|
866
|
-
unresolved.length > 0 ? "bg-og-accent-soft text-og-status-waiting hover:bg-og-surface-3 focus-visible:ring-og-status-waiting" : "bg-og-surface-3 text-og-fg-muted hover:text-og-fg focus-visible:ring-og-accent"
|
|
867
|
-
),
|
|
868
|
-
children: /* @__PURE__ */ jsx(MessageSquareTextIcon, { className: "size-3.5" })
|
|
869
|
-
}
|
|
870
|
-
) : null,
|
|
871
|
-
changes.length > 0 ? /* @__PURE__ */ jsx(
|
|
872
|
-
"span",
|
|
873
|
-
{
|
|
874
|
-
role: "img",
|
|
875
|
-
"aria-label": t("artifacts.documentEditor.trackedChanges", { count: changes.length }),
|
|
876
|
-
className: "mt-1 h-4 w-1 rounded-full bg-og-status-idle"
|
|
877
|
-
}
|
|
878
|
-
) : null,
|
|
879
|
-
commentPanelOpen ? /* @__PURE__ */ jsxs(
|
|
880
|
-
"aside",
|
|
881
|
-
{
|
|
882
|
-
"aria-label": t("artifacts.documentEditor.commentThread"),
|
|
883
|
-
className: "absolute right-0 top-8 z-20 w-64 rounded-og-md border border-og-border bg-og-surface-1 p-3 text-og-xs text-og-fg shadow-og-lg",
|
|
884
|
-
children: [
|
|
885
|
-
/* @__PURE__ */ jsx("div", { className: "mb-2 font-medium", children: comments.length === 1 ? t("artifacts.documentEditor.comment") : t("artifacts.documentEditor.lengthComments", { length: comments.length }) }),
|
|
886
|
-
/* @__PURE__ */ jsx("ol", { className: "max-h-72 space-y-3 overflow-y-auto", children: comments.map((thread) => /* @__PURE__ */ jsxs("li", { className: "space-y-2", children: [
|
|
887
|
-
/* @__PURE__ */ jsx("div", { className: "text-og-fg-muted", children: thread.resolved ? t("artifacts.documentEditor.resolved") : t("artifacts.documentEditor.open") }),
|
|
888
|
-
thread.replies.map((reply, index) => (
|
|
889
|
-
// Reply position is stable within the append-only comment thread.
|
|
890
|
-
// oxlint-disable-next-line react/no-array-index-key
|
|
891
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
892
|
-
/* @__PURE__ */ jsx("div", { className: "text-og-fg-muted", children: reply.author }),
|
|
893
|
-
/* @__PURE__ */ jsx("div", { className: "whitespace-pre-wrap", children: reply.text })
|
|
894
|
-
] }, `${reply.createdAt}:${index}`)
|
|
895
|
-
))
|
|
896
|
-
] }, thread.id)) })
|
|
897
|
-
]
|
|
898
|
-
}
|
|
899
|
-
) : null
|
|
900
|
-
] }) : null
|
|
901
|
-
]
|
|
902
|
-
}
|
|
903
|
-
);
|
|
904
|
-
}
|
|
905
|
-
var ParagraphLeaf = memo(
|
|
906
|
-
function ParagraphLeaf2({
|
|
907
|
-
paragraph,
|
|
908
|
-
viewBlockId,
|
|
909
|
-
segments,
|
|
910
|
-
paragraphStyle,
|
|
911
|
-
listOrdinal,
|
|
912
|
-
readOnly,
|
|
913
|
-
registerEditor,
|
|
914
|
-
onInput,
|
|
915
|
-
onBlur,
|
|
916
|
-
onSelection,
|
|
917
|
-
onKeyDown
|
|
918
|
-
}) {
|
|
919
|
-
const t = useOpenGeniText();
|
|
920
|
-
const composing = useRef(false);
|
|
921
|
-
const suppressNextEnter = useRef(false);
|
|
922
|
-
const Tag = headingTag(paragraph.style.headingLevel);
|
|
923
|
-
const label = paragraph.style.list?.kind === "number" ? t("artifacts.documentEditor.numberedListItemListordinal", {
|
|
924
|
-
listOrdinal: listOrdinal ?? 1
|
|
925
|
-
}) : paragraph.style.list?.kind === "bullet" ? t("artifacts.documentEditor.bulletListItem") : paragraph.style.headingLevel ? t("artifacts.documentEditor.headingHeadinglevel", {
|
|
926
|
-
headingLevel: paragraph.style.headingLevel
|
|
927
|
-
}) : t("artifacts.documentEditor.paragraph");
|
|
928
|
-
return /* @__PURE__ */ jsxs(
|
|
929
|
-
Tag,
|
|
930
|
-
{
|
|
931
|
-
ref: registerEditor,
|
|
932
|
-
contentEditable: !readOnly,
|
|
933
|
-
suppressContentEditableWarning: true,
|
|
934
|
-
tabIndex: readOnly ? 0 : void 0,
|
|
935
|
-
role: !readOnly && !paragraph.style.headingLevel ? "textbox" : void 0,
|
|
936
|
-
"aria-label": label,
|
|
937
|
-
"aria-multiline": !readOnly || void 0,
|
|
938
|
-
"aria-readonly": readOnly,
|
|
939
|
-
spellCheck: !readOnly,
|
|
940
|
-
"data-og-paragraph": viewBlockId,
|
|
941
|
-
onFocus: () => onSelection(paragraph),
|
|
942
|
-
onSelect: () => onSelection(paragraph),
|
|
943
|
-
onKeyUp: () => onSelection(paragraph),
|
|
944
|
-
onMouseUp: () => onSelection(paragraph),
|
|
945
|
-
onCompositionStart: () => {
|
|
946
|
-
composing.current = true;
|
|
947
|
-
},
|
|
948
|
-
onCompositionEnd: (event) => {
|
|
949
|
-
composing.current = false;
|
|
950
|
-
suppressNextEnter.current = true;
|
|
951
|
-
queueMicrotask(() => {
|
|
952
|
-
suppressNextEnter.current = false;
|
|
953
|
-
});
|
|
954
|
-
syncTrailingBreak(event.currentTarget);
|
|
955
|
-
stabilizeCaretAfterTrailingNewline(event.currentTarget);
|
|
956
|
-
onInput(paragraph, event.currentTarget.textContent ?? "");
|
|
957
|
-
onSelection(paragraph);
|
|
958
|
-
},
|
|
959
|
-
onPaste: (event) => {
|
|
960
|
-
if (readOnly) return;
|
|
961
|
-
event.preventDefault();
|
|
962
|
-
const text = event.clipboardData.getData("text/plain").slice(0, MAX_PLAIN_TEXT_TRANSFER);
|
|
963
|
-
if (!text) return;
|
|
964
|
-
insertPlainText(event.currentTarget, text);
|
|
965
|
-
onInput(paragraph, event.currentTarget.textContent ?? "");
|
|
966
|
-
onSelection(paragraph);
|
|
967
|
-
},
|
|
968
|
-
onDragOver: (event) => {
|
|
969
|
-
if (!readOnly) event.preventDefault();
|
|
970
|
-
},
|
|
971
|
-
onDrop: (event) => {
|
|
972
|
-
if (!readOnly) event.preventDefault();
|
|
973
|
-
},
|
|
974
|
-
onKeyDown: (event) => {
|
|
975
|
-
onKeyDown(event, paragraph);
|
|
976
|
-
if (event.defaultPrevented || readOnly) return;
|
|
977
|
-
if (event.key !== "Enter" || event.metaKey || event.ctrlKey || event.altKey) return;
|
|
978
|
-
if (isDocumentImeComposing(event, composing.current)) return;
|
|
979
|
-
event.preventDefault();
|
|
980
|
-
if (suppressNextEnter.current) return;
|
|
981
|
-
insertPlainText(event.currentTarget, "\n");
|
|
982
|
-
onInput(paragraph, event.currentTarget.textContent ?? "");
|
|
983
|
-
onSelection(paragraph);
|
|
984
|
-
},
|
|
985
|
-
onInput: (event) => {
|
|
986
|
-
if (!composing.current && !event.nativeEvent.isComposing) {
|
|
987
|
-
syncTrailingBreak(event.currentTarget);
|
|
988
|
-
stabilizeCaretAfterTrailingNewline(event.currentTarget);
|
|
989
|
-
onInput(paragraph, event.currentTarget.textContent ?? "");
|
|
990
|
-
}
|
|
991
|
-
},
|
|
992
|
-
onBlur,
|
|
993
|
-
className: cn(
|
|
994
|
-
"min-w-0 flex-1 whitespace-pre-wrap break-words rounded-sm outline-hidden",
|
|
995
|
-
!readOnly && "cursor-text focus-visible:ring-2 focus-visible:ring-og-accent"
|
|
996
|
-
),
|
|
997
|
-
style: paragraphStyle,
|
|
998
|
-
children: [
|
|
999
|
-
segments.map((segment, index) => /* @__PURE__ */ jsx(
|
|
1000
|
-
"span",
|
|
1001
|
-
{
|
|
1002
|
-
"data-og-commented": segment.commented || void 0,
|
|
1003
|
-
"data-og-change": segment.changeKind,
|
|
1004
|
-
style: segment.style,
|
|
1005
|
-
children: segment.text
|
|
1006
|
-
},
|
|
1007
|
-
`${segment.start}:${index}`
|
|
1008
|
-
)),
|
|
1009
|
-
segments.at(-1)?.text.endsWith("\n") ? /* @__PURE__ */ jsx("br", { "data-og-trailing-break": "", "aria-hidden": "true" }) : null
|
|
1010
|
-
]
|
|
1011
|
-
}
|
|
1012
|
-
);
|
|
1013
|
-
},
|
|
1014
|
-
(previous, next) => {
|
|
1015
|
-
if (next.readOnly || previous.viewBlockId !== next.viewBlockId) return false;
|
|
1016
|
-
const active = globalThis.document?.activeElement;
|
|
1017
|
-
return active instanceof HTMLElement && active.dataset.ogParagraph === next.viewBlockId;
|
|
1018
|
-
}
|
|
1019
|
-
);
|
|
1020
|
-
function DocumentTableView({
|
|
1021
|
-
table,
|
|
1022
|
-
viewBlockId
|
|
1023
|
-
}) {
|
|
1024
|
-
const columnWidths = table.style.columnWidthsPt;
|
|
1025
|
-
const headerColor = tableHeaderTextColor(table.style.headerFill);
|
|
1026
|
-
return /* @__PURE__ */ jsx(
|
|
1027
|
-
"div",
|
|
1028
|
-
{
|
|
1029
|
-
"data-og-document-block": viewBlockId,
|
|
1030
|
-
"data-og-block-kind": "table",
|
|
1031
|
-
className: "w-full max-w-full overflow-x-auto py-2",
|
|
1032
|
-
children: /* @__PURE__ */ jsxs(
|
|
1033
|
-
"table",
|
|
1034
|
-
{
|
|
1035
|
-
className: "w-full border-collapse text-left",
|
|
1036
|
-
style: {
|
|
1037
|
-
fontSize: "0.92em",
|
|
1038
|
-
width: table.style.widthPt ? `${table.style.widthPt}pt` : void 0
|
|
1039
|
-
},
|
|
1040
|
-
children: [
|
|
1041
|
-
columnWidths ? /* @__PURE__ */ jsx("colgroup", { children: columnWidths.map((width, index) => (
|
|
1042
|
-
// Column position is its identity in the document table model.
|
|
1043
|
-
// oxlint-disable-next-line react/no-array-index-key
|
|
1044
|
-
/* @__PURE__ */ jsx("col", { style: { width: `${width}pt` } }, index)
|
|
1045
|
-
)) }) : null,
|
|
1046
|
-
/* @__PURE__ */ jsx("tbody", { children: table.rows.map((row, rowIndex) => (
|
|
1047
|
-
// Row position is its identity in the document table model.
|
|
1048
|
-
// oxlint-disable-next-line react/no-array-index-key
|
|
1049
|
-
/* @__PURE__ */ jsx("tr", { children: row.map((cell, columnIndex) => {
|
|
1050
|
-
const header = rowIndex < (table.style.headerRows ?? 0);
|
|
1051
|
-
const Cell = header ? "th" : "td";
|
|
1052
|
-
return /* @__PURE__ */ jsx(
|
|
1053
|
-
Cell,
|
|
1054
|
-
{
|
|
1055
|
-
scope: header ? "col" : void 0,
|
|
1056
|
-
className: cn("border align-middle", header && "font-semibold"),
|
|
1057
|
-
style: {
|
|
1058
|
-
borderColor: table.style.borderColor ?? "#d1d5db",
|
|
1059
|
-
background: header ? table.style.headerFill ?? "#f3f4f6" : void 0,
|
|
1060
|
-
// An explicitly colored run still owns its authored text style.
|
|
1061
|
-
color: header ? headerColor : void 0,
|
|
1062
|
-
padding: `${table.style.cellPaddingPt ?? 6}pt`
|
|
1063
|
-
},
|
|
1064
|
-
children: cell.map((run, index) => (
|
|
1065
|
-
// Run position is stable within the immutable cell projection.
|
|
1066
|
-
// oxlint-disable-next-line react/no-array-index-key
|
|
1067
|
-
/* @__PURE__ */ jsx("span", { style: toRunStyle(run.style), children: run.text }, index)
|
|
1068
|
-
))
|
|
1069
|
-
},
|
|
1070
|
-
columnIndex
|
|
1071
|
-
);
|
|
1072
|
-
}) }, rowIndex)
|
|
1073
|
-
)) })
|
|
1074
|
-
]
|
|
1075
|
-
}
|
|
1076
|
-
)
|
|
1077
|
-
}
|
|
1078
|
-
);
|
|
1079
|
-
}
|
|
1080
|
-
function tableHeaderTextColor(fill) {
|
|
1081
|
-
if (!fill) return "#171717";
|
|
1082
|
-
const hex = /^#([\da-f]{3}|[\da-f]{6}|[\da-f]{8})$/i.exec(fill)?.[1];
|
|
1083
|
-
if (!hex) return void 0;
|
|
1084
|
-
const channels = hex.length === 3 ? [...hex].map((digit) => Number.parseInt(digit + digit, 16)) : [0, 2, 4].map((index) => Number.parseInt(hex.slice(index, index + 2), 16));
|
|
1085
|
-
const alpha = hex.length === 8 ? Number.parseInt(hex.slice(6), 16) / 255 : 1;
|
|
1086
|
-
const luminanceOn = (backdrop) => {
|
|
1087
|
-
const linear = channels.map((channel) => {
|
|
1088
|
-
const normalized = (channel * alpha + backdrop * (1 - alpha)) / 255;
|
|
1089
|
-
return normalized <= 0.04045 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
1090
|
-
});
|
|
1091
|
-
return linear[0] * 0.2126 + linear[1] * 0.7152 + linear[2] * 0.0722;
|
|
1092
|
-
};
|
|
1093
|
-
const backdrops = alpha < 1 ? [luminanceOn(0), luminanceOn(255)] : [luminanceOn(255)];
|
|
1094
|
-
const darkTextLuminance = ((23 / 255 + 0.055) / 1.055) ** 2.4;
|
|
1095
|
-
const whiteContrast = Math.min(...backdrops.map((value) => 1.05 / (value + 0.05)));
|
|
1096
|
-
const darkContrast = Math.min(
|
|
1097
|
-
...backdrops.map(
|
|
1098
|
-
(value) => (Math.max(value, darkTextLuminance) + 0.05) / (Math.min(value, darkTextLuminance) + 0.05)
|
|
1099
|
-
)
|
|
1100
|
-
);
|
|
1101
|
-
if (Math.max(whiteContrast, darkContrast) < 4.5) {
|
|
1102
|
-
return alpha < 1 ? void 0 : "#000";
|
|
1103
|
-
}
|
|
1104
|
-
return whiteContrast > darkContrast ? "#fff" : "#171717";
|
|
1105
|
-
}
|
|
1106
|
-
function ToolbarButton({
|
|
1107
|
-
label,
|
|
1108
|
-
shortcut,
|
|
1109
|
-
pressed,
|
|
1110
|
-
disabled,
|
|
1111
|
-
onPress,
|
|
1112
|
-
children
|
|
1113
|
-
}) {
|
|
1114
|
-
return /* @__PURE__ */ jsx(
|
|
1115
|
-
"button",
|
|
1116
|
-
{
|
|
1117
|
-
type: "button",
|
|
1118
|
-
"aria-label": label,
|
|
1119
|
-
"aria-pressed": pressed,
|
|
1120
|
-
title: shortcut ? `${label} (${shortcut})` : label,
|
|
1121
|
-
disabled,
|
|
1122
|
-
onMouseDown: (event) => event.preventDefault(),
|
|
1123
|
-
onClick: onPress,
|
|
1124
|
-
className: cn(
|
|
1125
|
-
"grid size-7 place-items-center rounded-og-sm text-og-fg-muted outline-hidden transition-colors hover:bg-og-surface-3 hover:text-og-fg focus-visible:ring-2 focus-visible:ring-og-accent disabled:pointer-events-none disabled:opacity-40",
|
|
1126
|
-
pressed && "bg-og-surface-3 text-og-fg"
|
|
1127
|
-
),
|
|
1128
|
-
children
|
|
1129
|
-
}
|
|
1130
|
-
);
|
|
1131
|
-
}
|
|
1132
|
-
function projectPages(document2, layout) {
|
|
1133
|
-
const pages = [];
|
|
1134
|
-
const sections = document2.sections.items;
|
|
1135
|
-
let sectionIndex = 0;
|
|
1136
|
-
let pageGeometry = sections[0]?.page ?? document2.page;
|
|
1137
|
-
let blocks = [];
|
|
1138
|
-
let used = 0;
|
|
1139
|
-
let pageIndex = 0;
|
|
1140
|
-
let numberOrdinal = 0;
|
|
1141
|
-
const flush = (force = false) => {
|
|
1142
|
-
if (blocks.length === 0 && !force) return;
|
|
1143
|
-
const physicalPageHeight = pageGeometry.heightPt * POINT_TO_CSS_PIXEL;
|
|
1144
|
-
const pageVerticalChrome = (pageGeometry.marginTopPt + pageGeometry.marginBottomPt) * POINT_TO_CSS_PIXEL;
|
|
1145
|
-
pages.push({
|
|
1146
|
-
key: `${layout}:${sections[sectionIndex]?.id ?? "default"}:${pageIndex++}:${blocks[0]?.block.id ?? "blank"}`,
|
|
1147
|
-
blocks,
|
|
1148
|
-
height: layout === "paginated" ? Math.max(physicalPageHeight, used + pageVerticalChrome) : Math.max(1, used + 48),
|
|
1149
|
-
minimumHeight: layout === "paginated" ? physicalPageHeight : 1,
|
|
1150
|
-
page: { ...pageGeometry }
|
|
1151
|
-
});
|
|
1152
|
-
blocks = [];
|
|
1153
|
-
used = 0;
|
|
1154
|
-
};
|
|
1155
|
-
for (let blockIndex = 0; blockIndex < document2.blocks.items.length; blockIndex += 1) {
|
|
1156
|
-
while (sectionIndex + 1 < sections.length && sections[sectionIndex + 1].startBlockIndex <= blockIndex) {
|
|
1157
|
-
flush();
|
|
1158
|
-
sectionIndex += 1;
|
|
1159
|
-
pageGeometry = sections[sectionIndex].page;
|
|
1160
|
-
}
|
|
1161
|
-
const block = document2.blocks.items[blockIndex];
|
|
1162
|
-
if (isDocumentPageBreak(block)) {
|
|
1163
|
-
flush(true);
|
|
1164
|
-
numberOrdinal = 0;
|
|
1165
|
-
continue;
|
|
1166
|
-
}
|
|
1167
|
-
if (isDocumentParagraph(block) && block.style.pageBreakBefore) flush();
|
|
1168
|
-
const height = estimateBlockHeight(block);
|
|
1169
|
-
const physicalPageHeight = pageGeometry.heightPt * POINT_TO_CSS_PIXEL;
|
|
1170
|
-
const usableHeight = Math.max(
|
|
1171
|
-
120,
|
|
1172
|
-
physicalPageHeight - (pageGeometry.marginTopPt + pageGeometry.marginBottomPt) * POINT_TO_CSS_PIXEL
|
|
1173
|
-
);
|
|
1174
|
-
const targetHeight = layout === "paginated" ? usableHeight : Math.max(560, usableHeight);
|
|
1175
|
-
if (blocks.length > 0 && used + height > targetHeight) flush();
|
|
1176
|
-
if (isDocumentParagraph(block) && block.style.list?.kind === "number") {
|
|
1177
|
-
numberOrdinal += 1;
|
|
1178
|
-
} else {
|
|
1179
|
-
numberOrdinal = 0;
|
|
1180
|
-
}
|
|
1181
|
-
blocks.push({
|
|
1182
|
-
block,
|
|
1183
|
-
height,
|
|
1184
|
-
listOrdinal: isDocumentParagraph(block) && block.style.list?.kind === "number" ? numberOrdinal : void 0
|
|
1185
|
-
});
|
|
1186
|
-
used += height;
|
|
1187
|
-
}
|
|
1188
|
-
flush();
|
|
1189
|
-
return pages;
|
|
1190
|
-
}
|
|
1191
|
-
function indexAnnotations(document2) {
|
|
1192
|
-
const comments = /* @__PURE__ */ new Map();
|
|
1193
|
-
const changes = /* @__PURE__ */ new Map();
|
|
1194
|
-
for (const thread of document2.comments.items) {
|
|
1195
|
-
const items = comments.get(thread.blockId);
|
|
1196
|
-
if (items) items.push(thread);
|
|
1197
|
-
else comments.set(thread.blockId, [thread]);
|
|
1198
|
-
}
|
|
1199
|
-
for (const change of document2.changes.items) {
|
|
1200
|
-
const items = changes.get(change.blockId);
|
|
1201
|
-
if (items) items.push(change);
|
|
1202
|
-
else changes.set(change.blockId, [change]);
|
|
1203
|
-
}
|
|
1204
|
-
return { comments, changes };
|
|
1205
|
-
}
|
|
1206
|
-
function estimateBlockHeight(block) {
|
|
1207
|
-
if (isDocumentTable(block)) {
|
|
1208
|
-
return Math.max(48, block.rows.length * 38 + 16);
|
|
1209
|
-
}
|
|
1210
|
-
const fontSize = block.runs.reduce(
|
|
1211
|
-
(largest, run) => Math.max(largest, run.style.fontSizePt ?? 11),
|
|
1212
|
-
block.style.headingLevel ? Math.max(14, 26 - block.style.headingLevel * 2) : 11
|
|
1213
|
-
);
|
|
1214
|
-
const lineHeight = fontSize * POINT_TO_CSS_PIXEL * (block.style.lineHeight ?? 1.35);
|
|
1215
|
-
const lines = Math.max(
|
|
1216
|
-
1,
|
|
1217
|
-
block.text.split("\n").reduce((total, line) => total + Math.max(1, Math.ceil(line.length / 72)), 0)
|
|
1218
|
-
);
|
|
1219
|
-
return Math.max(
|
|
1220
|
-
28,
|
|
1221
|
-
lines * lineHeight + ((block.style.spaceBeforePt ?? 2) + (block.style.spaceAfterPt ?? 6)) * POINT_TO_CSS_PIXEL
|
|
1222
|
-
);
|
|
1223
|
-
}
|
|
1224
|
-
function buildPageAxis(pages, gap) {
|
|
1225
|
-
const offsets = new Float64Array(pages.length + 1);
|
|
1226
|
-
for (let index = 0; index < pages.length; index += 1) {
|
|
1227
|
-
offsets[index + 1] = offsets[index] + pages[index].height + gap;
|
|
1228
|
-
}
|
|
1229
|
-
return { offsets, total: Math.max(1, (offsets[pages.length] ?? 0) - gap) };
|
|
1230
|
-
}
|
|
1231
|
-
function pageAtOffset(axis, count, offset) {
|
|
1232
|
-
if (count <= 1) return 0;
|
|
1233
|
-
let low = 0;
|
|
1234
|
-
let high = count;
|
|
1235
|
-
while (low < high) {
|
|
1236
|
-
const middle = low + high >>> 1;
|
|
1237
|
-
if (axis.offsets[middle + 1] <= offset) low = middle + 1;
|
|
1238
|
-
else high = middle;
|
|
1239
|
-
}
|
|
1240
|
-
return Math.max(0, Math.min(count - 1, low));
|
|
1241
|
-
}
|
|
1242
|
-
function visiblePageIndexes(axis, count, scrollTop, viewportHeight, overscan, required) {
|
|
1243
|
-
if (count === 0) return [];
|
|
1244
|
-
const start = Math.max(0, pageAtOffset(axis, count, scrollTop) - overscan);
|
|
1245
|
-
const end = Math.min(count, pageAtOffset(axis, count, scrollTop + viewportHeight) + overscan + 1);
|
|
1246
|
-
const indexes = Array.from({ length: end - start }, (_, index) => start + index);
|
|
1247
|
-
if (required >= 0 && (required < start || required >= end)) indexes.push(required);
|
|
1248
|
-
return indexes.sort((left, right) => left - right);
|
|
1249
|
-
}
|
|
1250
|
-
function responsiveDocumentPageScale(page, viewportWidth) {
|
|
1251
|
-
if (viewportWidth <= 0) return 1;
|
|
1252
|
-
const naturalWidth = page.widthPt * POINT_TO_CSS_PIXEL;
|
|
1253
|
-
return Math.min(1, Math.max(0.75, (viewportWidth - 32) / naturalWidth));
|
|
1254
|
-
}
|
|
1255
|
-
function pageContentStyle(page, layout) {
|
|
1256
|
-
if (layout === "continuous") {
|
|
1257
|
-
return {
|
|
1258
|
-
padding: "24px clamp(12px, 4cqw, 72px)"
|
|
1259
|
-
};
|
|
1260
|
-
}
|
|
1261
|
-
return {
|
|
1262
|
-
paddingTop: `${page.marginTopPt * POINT_TO_CSS_PIXEL}px`,
|
|
1263
|
-
paddingRight: `${page.marginRightPt * POINT_TO_CSS_PIXEL}px`,
|
|
1264
|
-
paddingBottom: `${page.marginBottomPt * POINT_TO_CSS_PIXEL}px`,
|
|
1265
|
-
paddingLeft: `${page.marginLeftPt * POINT_TO_CSS_PIXEL}px`
|
|
1266
|
-
};
|
|
1267
|
-
}
|
|
1268
|
-
function headingTag(level) {
|
|
1269
|
-
if (!level) return "p";
|
|
1270
|
-
return `h${Math.max(1, Math.min(6, level))}`;
|
|
1271
|
-
}
|
|
1272
|
-
function toParagraphStyle(paragraph) {
|
|
1273
|
-
const firstRun = paragraph.runs[0];
|
|
1274
|
-
return {
|
|
1275
|
-
textAlign: paragraph.style.alignment,
|
|
1276
|
-
marginTop: `${paragraph.style.spaceBeforePt ?? 0}pt`,
|
|
1277
|
-
marginBottom: `${paragraph.style.spaceAfterPt ?? 0}pt`,
|
|
1278
|
-
lineHeight: paragraph.style.lineHeight ?? 1.35,
|
|
1279
|
-
breakBefore: paragraph.style.pageBreakBefore ? "page" : void 0,
|
|
1280
|
-
fontFamily: firstRun?.style.fontFamily,
|
|
1281
|
-
fontSize: firstRun?.style.fontSizePt ? `${firstRun.style.fontSizePt}pt` : void 0,
|
|
1282
|
-
fontWeight: paragraph.style.headingLevel ? 650 : void 0
|
|
1283
|
-
};
|
|
1284
|
-
}
|
|
1285
|
-
function toRunStyle(style) {
|
|
1286
|
-
return {
|
|
1287
|
-
fontFamily: style.fontFamily,
|
|
1288
|
-
fontSize: style.fontSizePt ? `${style.fontSizePt}pt` : void 0,
|
|
1289
|
-
color: style.color,
|
|
1290
|
-
fontWeight: style.bold ? 700 : void 0,
|
|
1291
|
-
fontStyle: style.italic ? "italic" : void 0,
|
|
1292
|
-
textDecoration: [style.underline ? "underline" : "", style.strike ? "line-through" : ""].filter(Boolean).join(" ") || void 0
|
|
1293
|
-
};
|
|
1294
|
-
}
|
|
1295
|
-
function annotateRuns(paragraph, comments, changes) {
|
|
1296
|
-
const segments = [];
|
|
1297
|
-
let runStart = 0;
|
|
1298
|
-
for (const run of paragraph.runs) {
|
|
1299
|
-
const runEnd = runStart + run.text.length;
|
|
1300
|
-
const boundaries = /* @__PURE__ */ new Set([runStart, runEnd]);
|
|
1301
|
-
for (const annotation of [...comments, ...changes]) {
|
|
1302
|
-
if (annotation.start > runStart && annotation.start < runEnd)
|
|
1303
|
-
boundaries.add(annotation.start);
|
|
1304
|
-
if (annotation.end > runStart && annotation.end < runEnd) boundaries.add(annotation.end);
|
|
1305
|
-
}
|
|
1306
|
-
const ordered = [...boundaries].sort((left, right) => left - right);
|
|
1307
|
-
for (let index = 0; index < ordered.length - 1; index += 1) {
|
|
1308
|
-
const start = ordered[index];
|
|
1309
|
-
const end = ordered[index + 1];
|
|
1310
|
-
const commented = comments.some((comment) => comment.start < end && comment.end > start);
|
|
1311
|
-
const change = changes.find((item) => item.start < end && item.end > start);
|
|
1312
|
-
const baseStyle = toRunStyle(run.style);
|
|
1313
|
-
segments.push({
|
|
1314
|
-
text: run.text.slice(start - runStart, end - runStart),
|
|
1315
|
-
start,
|
|
1316
|
-
commented,
|
|
1317
|
-
changeKind: change?.kind,
|
|
1318
|
-
style: {
|
|
1319
|
-
...baseStyle,
|
|
1320
|
-
backgroundColor: commented ? "color-mix(in oklch, var(--og-color-status-waiting) 18%, transparent)" : void 0,
|
|
1321
|
-
textDecoration: change?.kind === "delete" ? "line-through" : change?.kind === "insert" ? "underline" : baseStyle.textDecoration,
|
|
1322
|
-
textDecorationColor: change?.kind === "delete" ? "var(--og-color-status-failed)" : change?.kind === "insert" ? "var(--og-color-status-idle)" : void 0
|
|
1323
|
-
}
|
|
1324
|
-
});
|
|
1325
|
-
}
|
|
1326
|
-
runStart = runEnd;
|
|
1327
|
-
}
|
|
1328
|
-
if (segments.length === 0) {
|
|
1329
|
-
segments.push({ text: "", start: 0, style: {}, commented: false });
|
|
1330
|
-
}
|
|
1331
|
-
return segments;
|
|
1332
|
-
}
|
|
1333
|
-
function selectionOffsets(root) {
|
|
1334
|
-
if (!root) return null;
|
|
1335
|
-
const selection = globalThis.getSelection?.();
|
|
1336
|
-
if (!selection || selection.rangeCount === 0) return null;
|
|
1337
|
-
const range = selection.getRangeAt(0);
|
|
1338
|
-
if (!root.contains(range.startContainer) || !root.contains(range.endContainer)) return null;
|
|
1339
|
-
const beforeStart = range.cloneRange();
|
|
1340
|
-
beforeStart.selectNodeContents(root);
|
|
1341
|
-
beforeStart.setEnd(range.startContainer, range.startOffset);
|
|
1342
|
-
const beforeEnd = range.cloneRange();
|
|
1343
|
-
beforeEnd.selectNodeContents(root);
|
|
1344
|
-
beforeEnd.setEnd(range.endContainer, range.endOffset);
|
|
1345
|
-
return {
|
|
1346
|
-
start: beforeStart.toString().length,
|
|
1347
|
-
end: beforeEnd.toString().length
|
|
1348
|
-
};
|
|
1349
|
-
}
|
|
1350
|
-
var TRAILING_BREAK_ATTR = "data-og-trailing-break";
|
|
1351
|
-
function isDocumentImeComposing(event, composing) {
|
|
1352
|
-
const native = event.nativeEvent;
|
|
1353
|
-
return composing || native.isComposing === true || native.keyCode === 229;
|
|
1354
|
-
}
|
|
1355
|
-
function syncTrailingBreak(root) {
|
|
1356
|
-
const existing = root.querySelector(`br[${TRAILING_BREAK_ATTR}]`);
|
|
1357
|
-
const needsBreak = (root.textContent ?? "").endsWith("\n");
|
|
1358
|
-
if (needsBreak && !existing) {
|
|
1359
|
-
const br = globalThis.document.createElement("br");
|
|
1360
|
-
br.setAttribute(TRAILING_BREAK_ATTR, "");
|
|
1361
|
-
br.setAttribute("aria-hidden", "true");
|
|
1362
|
-
root.appendChild(br);
|
|
1363
|
-
} else if (!needsBreak && existing) {
|
|
1364
|
-
existing.remove();
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
function stabilizeCaretAfterTrailingNewline(root) {
|
|
1368
|
-
const text = root.textContent ?? "";
|
|
1369
|
-
if (!text.endsWith("\n")) return;
|
|
1370
|
-
const selection = globalThis.getSelection?.();
|
|
1371
|
-
if (!selection || selection.rangeCount === 0 || !selection.isCollapsed) return;
|
|
1372
|
-
const offsets = selectionOffsets(root);
|
|
1373
|
-
if (!offsets || offsets.start !== text.length) return;
|
|
1374
|
-
const br = root.querySelector(`br[${TRAILING_BREAK_ATTR}]`);
|
|
1375
|
-
if (!br) return;
|
|
1376
|
-
const range = globalThis.document.createRange();
|
|
1377
|
-
range.setStartBefore(br);
|
|
1378
|
-
range.collapse(true);
|
|
1379
|
-
selection.removeAllRanges();
|
|
1380
|
-
selection.addRange(range);
|
|
1381
|
-
}
|
|
1382
|
-
function insertPlainText(root, text) {
|
|
1383
|
-
const selection = globalThis.getSelection?.();
|
|
1384
|
-
if (!selection || selection.rangeCount === 0) return;
|
|
1385
|
-
const range = selection.getRangeAt(0);
|
|
1386
|
-
if (!root.contains(range.startContainer) || !root.contains(range.endContainer)) return;
|
|
1387
|
-
range.deleteContents();
|
|
1388
|
-
const node = globalThis.document.createTextNode(text);
|
|
1389
|
-
range.insertNode(node);
|
|
1390
|
-
syncTrailingBreak(root);
|
|
1391
|
-
range.setStartAfter(node);
|
|
1392
|
-
range.collapse(true);
|
|
1393
|
-
selection.removeAllRanges();
|
|
1394
|
-
selection.addRange(range);
|
|
1395
|
-
stabilizeCaretAfterTrailingNewline(root);
|
|
1396
|
-
}
|
|
1397
|
-
function restoreSelection(root, requestedStart, requestedEnd) {
|
|
1398
|
-
if (!root || !globalThis.getSelection) return;
|
|
1399
|
-
const textLength = root.textContent?.length ?? 0;
|
|
1400
|
-
const start = Math.max(0, Math.min(requestedStart, textLength));
|
|
1401
|
-
const end = Math.max(start, Math.min(requestedEnd, textLength));
|
|
1402
|
-
const startPoint = textPointAt(root, start);
|
|
1403
|
-
const endPoint = textPointAt(root, end);
|
|
1404
|
-
if (!startPoint || !endPoint) return;
|
|
1405
|
-
const range = document.createRange();
|
|
1406
|
-
range.setStart(startPoint.node, startPoint.offset);
|
|
1407
|
-
range.setEnd(endPoint.node, endPoint.offset);
|
|
1408
|
-
const domSelection = globalThis.getSelection();
|
|
1409
|
-
domSelection?.removeAllRanges();
|
|
1410
|
-
domSelection?.addRange(range);
|
|
1411
|
-
}
|
|
1412
|
-
function textPointAt(root, target) {
|
|
1413
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
|
|
1414
|
-
let remaining = target;
|
|
1415
|
-
let node = walker.nextNode();
|
|
1416
|
-
while (node) {
|
|
1417
|
-
const length = node.textContent?.length ?? 0;
|
|
1418
|
-
if (remaining <= length) return { node, offset: remaining };
|
|
1419
|
-
remaining -= length;
|
|
1420
|
-
node = walker.nextNode();
|
|
1421
|
-
}
|
|
1422
|
-
return { node: root, offset: root.childNodes.length };
|
|
1423
|
-
}
|
|
1424
|
-
function toggledTextStyle(paragraph, start, end, property) {
|
|
1425
|
-
let allEnabled = end > start;
|
|
1426
|
-
let offset = 0;
|
|
1427
|
-
for (const run of paragraph.runs) {
|
|
1428
|
-
const runEnd = offset + run.text.length;
|
|
1429
|
-
if (runEnd > start && offset < end && run.style[property] !== true) {
|
|
1430
|
-
allEnabled = false;
|
|
1431
|
-
break;
|
|
1432
|
-
}
|
|
1433
|
-
offset = runEnd;
|
|
1434
|
-
}
|
|
1435
|
-
return { [property]: !allEnabled };
|
|
1436
|
-
}
|
|
1437
|
-
function documentViewFromProjection(projection) {
|
|
1438
|
-
if (projection.blocks.length > MAX_PROJECTION_BLOCKS) {
|
|
1439
|
-
throw new Error(`Document projection exceeds ${MAX_PROJECTION_BLOCKS} blocks`);
|
|
1440
|
-
}
|
|
1441
|
-
if ((projection.comments?.length ?? 0) > MAX_PROJECTION_ANNOTATIONS || (projection.changes?.length ?? 0) > MAX_PROJECTION_ANNOTATIONS) {
|
|
1442
|
-
throw new Error(`Document projection exceeds ${MAX_PROJECTION_ANNOTATIONS} annotations`);
|
|
1443
|
-
}
|
|
1444
|
-
const sections = [...projection.sections ?? []].sort(
|
|
1445
|
-
(left, right) => left.startBlockIndex - right.startBlockIndex
|
|
1446
|
-
);
|
|
1447
|
-
if (sections.some(
|
|
1448
|
-
(section, index) => section.startBlockIndex < 0 || index > 0 && section.startBlockIndex <= sections[index - 1].startBlockIndex
|
|
1449
|
-
)) {
|
|
1450
|
-
throw new Error("Document projection sections must have unique increasing block indexes");
|
|
1451
|
-
}
|
|
1452
|
-
const firstPage = sections[0]?.startBlockIndex === 0 ? sections[0].page : projection.page;
|
|
1453
|
-
validateProjectionPage(firstPage);
|
|
1454
|
-
const externalIdByInternal = /* @__PURE__ */ new Map();
|
|
1455
|
-
const paragraphByExternal = /* @__PURE__ */ new Map();
|
|
1456
|
-
const objects = /* @__PURE__ */ new Map();
|
|
1457
|
-
const blocks = [];
|
|
1458
|
-
const documentSections = [];
|
|
1459
|
-
const comments = [];
|
|
1460
|
-
const changes = [];
|
|
1461
|
-
const seenIds = /* @__PURE__ */ new Set();
|
|
1462
|
-
const remember = (internalId, externalId, value) => {
|
|
1463
|
-
if (!externalId || seenIds.has(externalId)) {
|
|
1464
|
-
throw new Error(`Document projection contains an invalid or duplicate id: ${externalId}`);
|
|
1465
|
-
}
|
|
1466
|
-
seenIds.add(externalId);
|
|
1467
|
-
externalIdByInternal.set(internalId, externalId);
|
|
1468
|
-
objects.set(internalId, value);
|
|
1469
|
-
};
|
|
1470
|
-
let revision = 0;
|
|
1471
|
-
let localParagraphId = 0;
|
|
1472
|
-
const changed = () => {
|
|
1473
|
-
revision += 1;
|
|
1474
|
-
};
|
|
1475
|
-
const document2 = {
|
|
1476
|
-
get revision() {
|
|
1477
|
-
return revision;
|
|
1478
|
-
},
|
|
1479
|
-
page: copyDocumentPage(firstPage),
|
|
1480
|
-
blocks: {
|
|
1481
|
-
items: blocks,
|
|
1482
|
-
addParagraph(text = "") {
|
|
1483
|
-
let id;
|
|
1484
|
-
do {
|
|
1485
|
-
localParagraphId += 1;
|
|
1486
|
-
id = `projection-paragraph-${localParagraphId}`;
|
|
1487
|
-
} while (objects.has(id));
|
|
1488
|
-
const paragraph = new ProjectionParagraphView(id, [{ text, style: {} }], {}, changed);
|
|
1489
|
-
blocks.push(paragraph);
|
|
1490
|
-
objects.set(id, paragraph);
|
|
1491
|
-
changed();
|
|
1492
|
-
return paragraph;
|
|
1493
|
-
}
|
|
1494
|
-
},
|
|
1495
|
-
sections: { items: documentSections },
|
|
1496
|
-
comments: { items: comments },
|
|
1497
|
-
changes: { items: changes },
|
|
1498
|
-
resolve(id) {
|
|
1499
|
-
const value = objects.get(id);
|
|
1500
|
-
if (!value) throw new Error(`Unknown document object id: ${id}`);
|
|
1501
|
-
return value;
|
|
1502
|
-
}
|
|
1503
|
-
};
|
|
1504
|
-
let sectionIndex = sections[0]?.startBlockIndex === 0 ? 1 : 0;
|
|
1505
|
-
if (sections[0]?.startBlockIndex === 0) {
|
|
1506
|
-
const projectedSection = sections[0];
|
|
1507
|
-
validateProjectionPage(projectedSection.page);
|
|
1508
|
-
const section = {
|
|
1509
|
-
...projectedSection,
|
|
1510
|
-
page: copyDocumentPage(projectedSection.page)
|
|
1511
|
-
};
|
|
1512
|
-
documentSections.push(section);
|
|
1513
|
-
remember(section.id, projectedSection.id, section);
|
|
1514
|
-
} else {
|
|
1515
|
-
documentSections.push({
|
|
1516
|
-
id: "projection-default-section",
|
|
1517
|
-
startBlockIndex: 0,
|
|
1518
|
-
page: copyDocumentPage(firstPage)
|
|
1519
|
-
});
|
|
1520
|
-
}
|
|
1521
|
-
for (let blockIndex = 0; blockIndex < projection.blocks.length; blockIndex += 1) {
|
|
1522
|
-
while (sections[sectionIndex]?.startBlockIndex === blockIndex) {
|
|
1523
|
-
const projectedSection = sections[sectionIndex];
|
|
1524
|
-
validateProjectionPage(projectedSection.page);
|
|
1525
|
-
const section = {
|
|
1526
|
-
...projectedSection,
|
|
1527
|
-
page: copyDocumentPage(projectedSection.page)
|
|
1528
|
-
};
|
|
1529
|
-
documentSections.push(section);
|
|
1530
|
-
remember(section.id, projectedSection.id, section);
|
|
1531
|
-
sectionIndex += 1;
|
|
1532
|
-
}
|
|
1533
|
-
const projectedBlock = projection.blocks[blockIndex];
|
|
1534
|
-
if (projectedBlock.kind === "paragraph") {
|
|
1535
|
-
const paragraph = new ProjectionParagraphView(
|
|
1536
|
-
projectedBlock.id,
|
|
1537
|
-
projectedBlock.runs.length > 0 ? projectedBlock.runs.map((run) => ({
|
|
1538
|
-
text: run.text.slice(0, MAX_PROJECTION_TEXT),
|
|
1539
|
-
style: { ...run.style ?? {} }
|
|
1540
|
-
})) : [{ text: "", style: {} }],
|
|
1541
|
-
{ ...projectedBlock.style ?? {} },
|
|
1542
|
-
changed
|
|
1543
|
-
);
|
|
1544
|
-
blocks.push(paragraph);
|
|
1545
|
-
remember(paragraph.id, projectedBlock.id, paragraph);
|
|
1546
|
-
paragraphByExternal.set(projectedBlock.id, paragraph);
|
|
1547
|
-
} else if (projectedBlock.kind === "table") {
|
|
1548
|
-
const columns = projectedBlock.rows.reduce(
|
|
1549
|
-
(maximum, row) => Math.max(maximum, row.length),
|
|
1550
|
-
0
|
|
1551
|
-
);
|
|
1552
|
-
if (projectedBlock.rows.length === 0 || columns === 0 || projectedBlock.rows.some((row) => row.length !== columns)) {
|
|
1553
|
-
throw new Error(`Document table ${projectedBlock.id} must be a non-empty rectangle`);
|
|
1554
|
-
}
|
|
1555
|
-
if (projectedBlock.rows.length * columns > MAX_PROJECTION_TABLE_CELLS) {
|
|
1556
|
-
throw new Error(`Document table ${projectedBlock.id} exceeds the projected cell limit`);
|
|
1557
|
-
}
|
|
1558
|
-
const table = {
|
|
1559
|
-
kind: "table",
|
|
1560
|
-
id: projectedBlock.id,
|
|
1561
|
-
rows: projectedBlock.rows.map(
|
|
1562
|
-
(row) => row.map(
|
|
1563
|
-
(cell) => cell.length > 0 ? cell.map((run) => ({
|
|
1564
|
-
text: run.text.slice(0, MAX_PROJECTION_TEXT),
|
|
1565
|
-
style: { ...run.style ?? {} }
|
|
1566
|
-
})) : [{ text: "", style: {} }]
|
|
1567
|
-
)
|
|
1568
|
-
),
|
|
1569
|
-
style: { ...projectedBlock.style ?? {} }
|
|
1570
|
-
};
|
|
1571
|
-
blocks.push(table);
|
|
1572
|
-
remember(table.id, projectedBlock.id, table);
|
|
1573
|
-
} else {
|
|
1574
|
-
const pageBreak = {
|
|
1575
|
-
kind: "pageBreak",
|
|
1576
|
-
id: projectedBlock.id
|
|
1577
|
-
};
|
|
1578
|
-
blocks.push(pageBreak);
|
|
1579
|
-
remember(pageBreak.id, projectedBlock.id, pageBreak);
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
while (sections[sectionIndex]?.startBlockIndex === projection.blocks.length) {
|
|
1583
|
-
const projectedSection = sections[sectionIndex];
|
|
1584
|
-
validateProjectionPage(projectedSection.page);
|
|
1585
|
-
const section = {
|
|
1586
|
-
...projectedSection,
|
|
1587
|
-
page: copyDocumentPage(projectedSection.page)
|
|
1588
|
-
};
|
|
1589
|
-
documentSections.push(section);
|
|
1590
|
-
remember(section.id, projectedSection.id, section);
|
|
1591
|
-
sectionIndex += 1;
|
|
1592
|
-
}
|
|
1593
|
-
if (sectionIndex < sections.length) {
|
|
1594
|
-
throw new Error("Document projection section starts beyond the projected blocks");
|
|
1595
|
-
}
|
|
1596
|
-
for (const projected of projection.comments ?? []) {
|
|
1597
|
-
const paragraph = paragraphByExternal.get(projected.blockId);
|
|
1598
|
-
const first = projected.replies[0];
|
|
1599
|
-
if (!paragraph || !first) continue;
|
|
1600
|
-
if (!Number.isSafeInteger(projected.start) || !Number.isSafeInteger(projected.end) || projected.start < 0 || projected.end < projected.start || projected.end > paragraph.text.length) {
|
|
1601
|
-
throw new Error(`Document comment ${projected.id} has an invalid range`);
|
|
1602
|
-
}
|
|
1603
|
-
const thread = {
|
|
1604
|
-
...projected,
|
|
1605
|
-
replies: projected.replies.map((reply) => ({ ...reply }))
|
|
1606
|
-
};
|
|
1607
|
-
comments.push(thread);
|
|
1608
|
-
remember(thread.id, projected.id, thread);
|
|
1609
|
-
}
|
|
1610
|
-
for (const projected of projection.changes ?? []) {
|
|
1611
|
-
const paragraph = paragraphByExternal.get(projected.blockId);
|
|
1612
|
-
if (!paragraph) continue;
|
|
1613
|
-
if (!Number.isSafeInteger(projected.start) || !Number.isSafeInteger(projected.end) || projected.start < 0 || projected.end <= projected.start || projected.end > paragraph.text.length) {
|
|
1614
|
-
throw new Error(`Document tracked change ${projected.id} has an invalid range`);
|
|
1615
|
-
}
|
|
1616
|
-
const change = { ...projected };
|
|
1617
|
-
changes.push(change);
|
|
1618
|
-
remember(change.id, projected.id, change);
|
|
1619
|
-
}
|
|
1620
|
-
return { document: document2, externalIdByInternal };
|
|
1621
|
-
}
|
|
1622
|
-
function copyDocumentPage(page) {
|
|
1623
|
-
return {
|
|
1624
|
-
widthPt: page.widthPt,
|
|
1625
|
-
heightPt: page.heightPt,
|
|
1626
|
-
marginTopPt: page.marginTopPt,
|
|
1627
|
-
marginRightPt: page.marginRightPt,
|
|
1628
|
-
marginBottomPt: page.marginBottomPt,
|
|
1629
|
-
marginLeftPt: page.marginLeftPt,
|
|
1630
|
-
...page.headerPt === void 0 ? {} : { headerPt: page.headerPt },
|
|
1631
|
-
...page.footerPt === void 0 ? {} : { footerPt: page.footerPt },
|
|
1632
|
-
...page.gutterPt === void 0 ? {} : { gutterPt: page.gutterPt }
|
|
1633
|
-
};
|
|
1634
|
-
}
|
|
1635
|
-
var ProjectionParagraphView = class {
|
|
1636
|
-
constructor(id, runs, style, changed) {
|
|
1637
|
-
this.id = id;
|
|
1638
|
-
this.changed = changed;
|
|
1639
|
-
this.runStorage = normalizeProjectionRuns(runs);
|
|
1640
|
-
this.style = { ...style, ...style.list ? { list: { ...style.list } } : {} };
|
|
1641
|
-
}
|
|
1642
|
-
kind = "paragraph";
|
|
1643
|
-
runStorage;
|
|
1644
|
-
style;
|
|
1645
|
-
get runs() {
|
|
1646
|
-
return this.runStorage;
|
|
1647
|
-
}
|
|
1648
|
-
get text() {
|
|
1649
|
-
return this.runStorage.map((run) => run.text).join("");
|
|
1650
|
-
}
|
|
1651
|
-
set text(value) {
|
|
1652
|
-
const current = this.text;
|
|
1653
|
-
if (current === value) return;
|
|
1654
|
-
let start = 0;
|
|
1655
|
-
while (start < current.length && start < value.length && current[start] === value[start]) {
|
|
1656
|
-
start += 1;
|
|
1657
|
-
}
|
|
1658
|
-
let currentEnd = current.length;
|
|
1659
|
-
let valueEnd = value.length;
|
|
1660
|
-
while (currentEnd > start && valueEnd > start && current[currentEnd - 1] === value[valueEnd - 1]) {
|
|
1661
|
-
currentEnd -= 1;
|
|
1662
|
-
valueEnd -= 1;
|
|
1663
|
-
}
|
|
1664
|
-
const inheritedStyle = projectionStyleAt(this.runStorage, start);
|
|
1665
|
-
this.runStorage = normalizeProjectionRuns([
|
|
1666
|
-
...sliceProjectionRuns(this.runStorage, 0, start),
|
|
1667
|
-
...valueEnd > start ? [{ text: value.slice(start, valueEnd), style: inheritedStyle }] : [],
|
|
1668
|
-
...sliceProjectionRuns(this.runStorage, currentEnd, current.length)
|
|
1669
|
-
]);
|
|
1670
|
-
this.changed();
|
|
1671
|
-
}
|
|
1672
|
-
format({
|
|
1673
|
-
start,
|
|
1674
|
-
end,
|
|
1675
|
-
style
|
|
1676
|
-
}) {
|
|
1677
|
-
const textLength = this.text.length;
|
|
1678
|
-
if (start < 0 || end <= start || end > textLength || Object.keys(style).length === 0) return;
|
|
1679
|
-
this.runStorage = normalizeProjectionRuns([
|
|
1680
|
-
...sliceProjectionRuns(this.runStorage, 0, start),
|
|
1681
|
-
...sliceProjectionRuns(this.runStorage, start, end).map((run) => ({
|
|
1682
|
-
text: run.text,
|
|
1683
|
-
style: { ...run.style, ...style }
|
|
1684
|
-
})),
|
|
1685
|
-
...sliceProjectionRuns(this.runStorage, end, textLength)
|
|
1686
|
-
]);
|
|
1687
|
-
this.changed();
|
|
1688
|
-
}
|
|
1689
|
-
};
|
|
1690
|
-
function sliceProjectionRuns(runs, start, end) {
|
|
1691
|
-
if (end <= start) return [];
|
|
1692
|
-
const result = [];
|
|
1693
|
-
let offset = 0;
|
|
1694
|
-
for (const run of runs) {
|
|
1695
|
-
const runEnd = offset + run.text.length;
|
|
1696
|
-
const overlapStart = Math.max(start, offset);
|
|
1697
|
-
const overlapEnd = Math.min(end, runEnd);
|
|
1698
|
-
if (overlapEnd > overlapStart) {
|
|
1699
|
-
result.push({
|
|
1700
|
-
text: run.text.slice(overlapStart - offset, overlapEnd - offset),
|
|
1701
|
-
style: { ...run.style }
|
|
1702
|
-
});
|
|
1703
|
-
}
|
|
1704
|
-
offset = runEnd;
|
|
1705
|
-
if (offset >= end) break;
|
|
1706
|
-
}
|
|
1707
|
-
return result;
|
|
1708
|
-
}
|
|
1709
|
-
function normalizeProjectionRuns(runs) {
|
|
1710
|
-
const normalized = [];
|
|
1711
|
-
for (const run of runs) {
|
|
1712
|
-
if (!run.text && runs.length > 1) continue;
|
|
1713
|
-
const style = { ...run.style };
|
|
1714
|
-
const previous = normalized.at(-1);
|
|
1715
|
-
if (previous && sameProjectionStyle(previous.style, style)) {
|
|
1716
|
-
normalized[normalized.length - 1] = { text: previous.text + run.text, style };
|
|
1717
|
-
} else {
|
|
1718
|
-
normalized.push({ text: run.text, style });
|
|
1719
|
-
}
|
|
1720
|
-
}
|
|
1721
|
-
return normalized.length > 0 ? normalized : [{ text: "", style: {} }];
|
|
1722
|
-
}
|
|
1723
|
-
function projectionStyleAt(runs, offset) {
|
|
1724
|
-
let cursor = 0;
|
|
1725
|
-
for (const run of runs) {
|
|
1726
|
-
const end = cursor + run.text.length;
|
|
1727
|
-
if (offset <= end) return { ...run.style };
|
|
1728
|
-
cursor = end;
|
|
1729
|
-
}
|
|
1730
|
-
return { ...runs.at(-1)?.style ?? {} };
|
|
1731
|
-
}
|
|
1732
|
-
function sameProjectionStyle(left, right) {
|
|
1733
|
-
return left.fontFamily === right.fontFamily && left.fontSizePt === right.fontSizePt && left.color === right.color && left.bold === right.bold && left.italic === right.italic && left.underline === right.underline && left.strike === right.strike;
|
|
1734
|
-
}
|
|
1735
|
-
function validateProjectionPage(page) {
|
|
1736
|
-
const values = [
|
|
1737
|
-
page.widthPt,
|
|
1738
|
-
page.heightPt,
|
|
1739
|
-
page.marginTopPt,
|
|
1740
|
-
page.marginRightPt,
|
|
1741
|
-
page.marginBottomPt,
|
|
1742
|
-
page.marginLeftPt
|
|
1743
|
-
];
|
|
1744
|
-
if (values.some((value) => !Number.isFinite(value) || value < 0) || page.widthPt <= 0 || page.heightPt <= 0 || page.marginLeftPt + page.marginRightPt >= page.widthPt || page.marginTopPt + page.marginBottomPt >= page.heightPt) {
|
|
1745
|
-
throw new Error("Document projection contains invalid page geometry");
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
function isDocumentParagraph(value) {
|
|
1749
|
-
return isDocumentBlockKind(value, "paragraph");
|
|
1750
|
-
}
|
|
1751
|
-
function isDocumentTable(value) {
|
|
1752
|
-
return isDocumentBlockKind(value, "table");
|
|
1753
|
-
}
|
|
1754
|
-
function isDocumentPageBreak(value) {
|
|
1755
|
-
return isDocumentBlockKind(value, "pageBreak");
|
|
1756
|
-
}
|
|
1757
|
-
function isDocumentBlockKind(value, kind) {
|
|
1758
|
-
return typeof value === "object" && value !== null && "kind" in value && value.kind === kind;
|
|
1759
|
-
}
|
|
1760
|
-
function asDocumentView(document2) {
|
|
1761
|
-
return document2;
|
|
1762
|
-
}
|
|
1763
|
-
function mapDocumentCommit(command, externalIdByInternal) {
|
|
1764
|
-
return {
|
|
1765
|
-
...command,
|
|
1766
|
-
blockId: externalIdByInternal.get(command.blockId) ?? command.blockId
|
|
1767
|
-
};
|
|
1768
|
-
}
|
|
1769
|
-
function identity(value) {
|
|
1770
|
-
return value;
|
|
1771
|
-
}
|
|
1772
|
-
function asDocumentError(cause) {
|
|
1773
|
-
return cause instanceof Error ? cause : new Error("Document change failed");
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1776
|
-
// src/components/artifacts/editable-document.tsx
|
|
1777
|
-
import {
|
|
1778
|
-
DOCUMENT_ARTIFACT_COMMAND_VERSION
|
|
1779
|
-
} from "@opengeni/sdk/editable-artifacts";
|
|
1780
|
-
import { useCallback as useCallback2, useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
|
|
1781
|
-
import { Fragment, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
1782
|
-
var DOCUMENT_PAGE_ITEMS = 512;
|
|
1783
|
-
var DOCUMENT_MAX_BLOCKS = 4096;
|
|
1784
|
-
var DOCUMENT_MAX_SECTIONS = 1024;
|
|
1785
|
-
var DOCUMENT_MAX_REVIEW_ITEMS = 4096;
|
|
1786
|
-
var DOCUMENT_MAX_TEXT_UTF16 = 1e6;
|
|
1787
|
-
var DOCUMENT_MAX_TABLE_CELLS = 1e5;
|
|
1788
|
-
var DOCUMENT_MAX_QUERY_PAGES = 64;
|
|
1789
|
-
var DOCUMENT_COMPOSITION_ATTEMPTS = 3;
|
|
1790
|
-
function EditableDocumentArtifactSurface(props) {
|
|
1791
|
-
return /* @__PURE__ */ jsx2(ArtifactSubmissionProvider, { children: /* @__PURE__ */ jsx2(EditableDocumentArtifactSurfaceSession, { ...props }) }, artifactSubmissionSessionKey(props.session));
|
|
1792
|
-
}
|
|
1793
|
-
function EditableDocumentArtifactSurfaceSession({
|
|
1794
|
-
session,
|
|
1795
|
-
title,
|
|
1796
|
-
showHeader,
|
|
1797
|
-
subtitle,
|
|
1798
|
-
readOnly = false,
|
|
1799
|
-
onCommit,
|
|
1800
|
-
onCommandError,
|
|
1801
|
-
download,
|
|
1802
|
-
actions: actionsProp,
|
|
1803
|
-
...surfaceProps
|
|
1804
|
-
}) {
|
|
1805
|
-
const t = useOpenGeniText();
|
|
1806
|
-
const view = useEditableArtifactView(session);
|
|
1807
|
-
const submissions = useArtifactSubmissions();
|
|
1808
|
-
const invalidator = editableArtifactProjectionKey(view);
|
|
1809
|
-
const [retryEpoch, setRetryEpoch] = useState2(0);
|
|
1810
|
-
const [state, setState] = useState2({
|
|
1811
|
-
session,
|
|
1812
|
-
projection: null,
|
|
1813
|
-
loading: true,
|
|
1814
|
-
error: null
|
|
1815
|
-
});
|
|
1816
|
-
const loadGeneration = useRef2(0);
|
|
1817
|
-
const scheduleLoad = useLatestTaskRunner(session);
|
|
1818
|
-
const commandStateRef = useRef2(null);
|
|
1819
|
-
if (commandStateRef.current?.session !== session) {
|
|
1820
|
-
commandStateRef.current = {
|
|
1821
|
-
session,
|
|
1822
|
-
tail: Promise.resolve(),
|
|
1823
|
-
paragraphText: /* @__PURE__ */ new Map(),
|
|
1824
|
-
localParagraphIds: /* @__PURE__ */ new Set(),
|
|
1825
|
-
optimisticParagraphIds: /* @__PURE__ */ new Map()
|
|
1826
|
-
};
|
|
1827
|
-
}
|
|
1828
|
-
const commandState = commandStateRef.current;
|
|
1829
|
-
useEffect2(() => {
|
|
1830
|
-
const generation = ++loadGeneration.current;
|
|
1831
|
-
let cancelled = false;
|
|
1832
|
-
setState(
|
|
1833
|
-
(current) => current.session === session ? { ...current, loading: true, error: null } : { session, projection: null, loading: true, error: null }
|
|
1834
|
-
);
|
|
1835
|
-
const superseded = () => cancelled || generation !== loadGeneration.current || commandStateRef.current !== commandState;
|
|
1836
|
-
scheduleLoad(async () => {
|
|
1837
|
-
if (superseded()) return;
|
|
1838
|
-
await composeDocumentEditorProjection(t, session).then(
|
|
1839
|
-
(projection2) => {
|
|
1840
|
-
if (superseded()) return;
|
|
1841
|
-
const nextParagraphText = paragraphTextById(projection2);
|
|
1842
|
-
for (const [localId, canonicalId] of commandState.optimisticParagraphIds) {
|
|
1843
|
-
if (nextParagraphText.has(canonicalId)) continue;
|
|
1844
|
-
const optimisticText = commandState.paragraphText.get(canonicalId) ?? commandState.paragraphText.get(localId);
|
|
1845
|
-
if (optimisticText !== void 0) nextParagraphText.set(canonicalId, optimisticText);
|
|
1846
|
-
}
|
|
1847
|
-
commandState.paragraphText = nextParagraphText;
|
|
1848
|
-
setState({ session, projection: projection2, loading: false, error: null });
|
|
1849
|
-
},
|
|
1850
|
-
(cause) => {
|
|
1851
|
-
if (superseded()) return;
|
|
1852
|
-
setState({
|
|
1853
|
-
session,
|
|
1854
|
-
projection: null,
|
|
1855
|
-
loading: false,
|
|
1856
|
-
error: asEditableArtifactError(
|
|
1857
|
-
cause,
|
|
1858
|
-
t("artifacts.editableDocument.couldNotOpenThisDocument")
|
|
1859
|
-
)
|
|
1860
|
-
});
|
|
1861
|
-
}
|
|
1862
|
-
);
|
|
1863
|
-
});
|
|
1864
|
-
return () => {
|
|
1865
|
-
cancelled = true;
|
|
1866
|
-
};
|
|
1867
|
-
}, [commandState, invalidator, retryEpoch, scheduleLoad, session, t]);
|
|
1868
|
-
const refresh = useCallback2(() => setRetryEpoch((value) => value + 1), []);
|
|
1869
|
-
const writable = !readOnly && view.writable;
|
|
1870
|
-
const applyCommit = useCallback2(
|
|
1871
|
-
(commit) => {
|
|
1872
|
-
const projection2 = state.session === session ? state.projection : null;
|
|
1873
|
-
if (!projection2) return Promise.reject(new Error("Document projection is not ready"));
|
|
1874
|
-
if (!writable)
|
|
1875
|
-
return Promise.reject(new Error(t("artifacts.editableDocument.thisDocumentIsReadOnly")));
|
|
1876
|
-
if (String(commit.revision) !== String(projection2.revision)) {
|
|
1877
|
-
return Promise.reject(
|
|
1878
|
-
new Error(t("artifacts.editableDocument.theDocumentChangedRetryThis"))
|
|
1879
|
-
);
|
|
1880
|
-
}
|
|
1881
|
-
const execute = async () => {
|
|
1882
|
-
if (commandStateRef.current !== commandState) {
|
|
1883
|
-
throw new Error(t("artifacts.editableDocument.theDocumentSessionChangedBefore"));
|
|
1884
|
-
}
|
|
1885
|
-
const allocateLocalParagraph = async (localId) => {
|
|
1886
|
-
const allocated = commandState.optimisticParagraphIds.get(localId);
|
|
1887
|
-
if (allocated !== void 0) return allocated;
|
|
1888
|
-
if (!commandState.localParagraphIds.has(localId)) {
|
|
1889
|
-
throw new Error(t("artifacts.editableDocument.theEditedParagraphIsNo"));
|
|
1890
|
-
}
|
|
1891
|
-
const created = await session.createDocumentParagraph();
|
|
1892
|
-
if (commandStateRef.current !== commandState) {
|
|
1893
|
-
throw new Error(t("artifacts.editableDocument.theDocumentSessionChangedBefore"));
|
|
1894
|
-
}
|
|
1895
|
-
commandState.optimisticParagraphIds.set(localId, created.paragraphId);
|
|
1896
|
-
commandState.paragraphText.set(created.paragraphId, "");
|
|
1897
|
-
return created.paragraphId;
|
|
1898
|
-
};
|
|
1899
|
-
if (commit.kind === "insert-paragraph") {
|
|
1900
|
-
commandState.localParagraphIds.add(commit.blockId);
|
|
1901
|
-
await allocateLocalParagraph(commit.blockId);
|
|
1902
|
-
notifyDocumentCommit(t, onCommit, onCommandError, commit);
|
|
1903
|
-
refresh();
|
|
1904
|
-
return;
|
|
1905
|
-
}
|
|
1906
|
-
const targetId = commandState.localParagraphIds.has(commit.blockId) ? await allocateLocalParagraph(commit.blockId) : commit.blockId;
|
|
1907
|
-
let command = null;
|
|
1908
|
-
let rollbackText = null;
|
|
1909
|
-
if (commit.kind === "text") {
|
|
1910
|
-
const before = commandState.paragraphText.get(targetId);
|
|
1911
|
-
if (before === void 0) {
|
|
1912
|
-
throw new Error(t("artifacts.editableDocument.theEditedParagraphIsNo"));
|
|
1913
|
-
}
|
|
1914
|
-
const edit = minimalUtf16TextEdit(before, commit.text);
|
|
1915
|
-
if (!edit) return;
|
|
1916
|
-
commandState.paragraphText.set(targetId, commit.text);
|
|
1917
|
-
rollbackText = () => {
|
|
1918
|
-
if (commandState.paragraphText.get(targetId) === commit.text) {
|
|
1919
|
-
commandState.paragraphText.set(targetId, before);
|
|
1920
|
-
}
|
|
1921
|
-
};
|
|
1922
|
-
command = {
|
|
1923
|
-
kind: "paragraph.edit",
|
|
1924
|
-
id: targetId,
|
|
1925
|
-
range: edit.range,
|
|
1926
|
-
replacement: edit.replacement,
|
|
1927
|
-
style: null
|
|
1928
|
-
};
|
|
1929
|
-
} else if (commit.kind === "format") {
|
|
1930
|
-
command = {
|
|
1931
|
-
kind: "paragraph.format",
|
|
1932
|
-
id: targetId,
|
|
1933
|
-
range: commit.range,
|
|
1934
|
-
style: documentTextStylePatch(commit.style)
|
|
1935
|
-
};
|
|
1936
|
-
}
|
|
1937
|
-
if (!command) throw new Error("Unsupported document edit");
|
|
1938
|
-
try {
|
|
1939
|
-
await session.applyDocumentCommands({
|
|
1940
|
-
version: DOCUMENT_ARTIFACT_COMMAND_VERSION,
|
|
1941
|
-
commands: [command]
|
|
1942
|
-
});
|
|
1943
|
-
if (commandStateRef.current !== commandState) return;
|
|
1944
|
-
notifyDocumentCommit(t, onCommit, onCommandError, commit);
|
|
1945
|
-
refresh();
|
|
1946
|
-
} catch (cause) {
|
|
1947
|
-
rollbackText?.();
|
|
1948
|
-
throw cause;
|
|
1949
|
-
}
|
|
1950
|
-
};
|
|
1951
|
-
const operation = commandState.tail.then(execute, execute);
|
|
1952
|
-
commandState.tail = operation;
|
|
1953
|
-
void operation.then(
|
|
1954
|
-
() => {
|
|
1955
|
-
if (commandState.tail === operation) commandState.tail = Promise.resolve();
|
|
1956
|
-
},
|
|
1957
|
-
() => {
|
|
1958
|
-
if (commandState.tail === operation) commandState.tail = Promise.resolve();
|
|
1959
|
-
}
|
|
1960
|
-
);
|
|
1961
|
-
return operation;
|
|
1962
|
-
},
|
|
1963
|
-
[commandState, onCommandError, onCommit, refresh, session, state, writable, t]
|
|
1964
|
-
);
|
|
1965
|
-
const submitCommit = useCallback2(
|
|
1966
|
-
(commit) => submissions.run(() => applyCommit(commit)),
|
|
1967
|
-
[applyCommit, submissions]
|
|
1968
|
-
);
|
|
1969
|
-
const actions = download ? /* @__PURE__ */ jsxs2(Fragment, { children: [
|
|
1970
|
-
actionsProp,
|
|
1971
|
-
/* @__PURE__ */ jsx2(
|
|
1972
|
-
EditableArtifactDownloadButton,
|
|
1973
|
-
{
|
|
1974
|
-
session,
|
|
1975
|
-
title,
|
|
1976
|
-
download,
|
|
1977
|
-
format: "docx"
|
|
1978
|
-
}
|
|
1979
|
-
)
|
|
1980
|
-
] }) : actionsProp;
|
|
1981
|
-
const projection = state.session === session ? state.projection : null;
|
|
1982
|
-
const status = editableArtifactStatusLabel(t, view);
|
|
1983
|
-
const accessRevoked = editableArtifactAccessRevoked(view);
|
|
1984
|
-
return projection && !accessRevoked ? /* @__PURE__ */ jsx2(
|
|
1985
|
-
DocumentProjectionArtifactSurface,
|
|
1986
|
-
{
|
|
1987
|
-
...surfaceProps,
|
|
1988
|
-
title,
|
|
1989
|
-
showHeader,
|
|
1990
|
-
actions,
|
|
1991
|
-
subtitle: subtitle ?? writable ? t("counts.blocks", { count: projection.blocks.length }) : t("artifacts.readOnlySubtitle", {
|
|
1992
|
-
subtitle: t("counts.blocks", { count: projection.blocks.length })
|
|
1993
|
-
}),
|
|
1994
|
-
projection,
|
|
1995
|
-
commit: writable ? submitCommit : void 0,
|
|
1996
|
-
readOnly: !writable,
|
|
1997
|
-
busy: state.loading,
|
|
1998
|
-
onCommandError
|
|
1999
|
-
}
|
|
2000
|
-
) : /* @__PURE__ */ jsx2(
|
|
2001
|
-
ArtifactSurface,
|
|
2002
|
-
{
|
|
2003
|
-
modality: "document",
|
|
2004
|
-
title,
|
|
2005
|
-
showHeader,
|
|
2006
|
-
subtitle: subtitle ?? status,
|
|
2007
|
-
actions: accessRevoked ? actionsProp : actions,
|
|
2008
|
-
busy: !accessRevoked && !state.error,
|
|
2009
|
-
className: surfaceProps.className,
|
|
2010
|
-
children: /* @__PURE__ */ jsx2(
|
|
2011
|
-
EditableArtifactMessage,
|
|
2012
|
-
{
|
|
2013
|
-
title: accessRevoked ? t("artifacts.editableDocument.accessChanged") : state.error ? t("artifacts.editableDocument.couldNotOpenThisDocument") : t("artifacts.editableDocument.openingDocument"),
|
|
2014
|
-
detail: accessRevoked ? status : state.error?.message ?? status,
|
|
2015
|
-
retry: !accessRevoked && state.error ? refresh : void 0
|
|
2016
|
-
}
|
|
2017
|
-
)
|
|
2018
|
-
}
|
|
2019
|
-
);
|
|
2020
|
-
}
|
|
2021
|
-
async function composeDocumentEditorProjection(t, session) {
|
|
2022
|
-
if (session.modality !== "document") throw new Error("Expected a document artifact session");
|
|
2023
|
-
let lastRevisionError = null;
|
|
2024
|
-
for (let attempt = 0; attempt < DOCUMENT_COMPOSITION_ATTEMPTS; attempt += 1) {
|
|
2025
|
-
try {
|
|
2026
|
-
return await composeDocumentAttempt(session);
|
|
2027
|
-
} catch (cause) {
|
|
2028
|
-
const error = asEditableArtifactError(
|
|
2029
|
-
cause,
|
|
2030
|
-
t("artifacts.editableDocument.couldNotProjectThisDocument")
|
|
2031
|
-
);
|
|
2032
|
-
if (!isRevisionDrift(error) || attempt === DOCUMENT_COMPOSITION_ATTEMPTS - 1) throw error;
|
|
2033
|
-
lastRevisionError = error;
|
|
2034
|
-
}
|
|
2035
|
-
}
|
|
2036
|
-
throw lastRevisionError ?? new Error("Document changed while it was opening");
|
|
2037
|
-
}
|
|
2038
|
-
async function composeDocumentAttempt(session) {
|
|
2039
|
-
const summaryPage = await session.queryDocument({ kind: "summary" });
|
|
2040
|
-
const summary = summaryItem(summaryPage);
|
|
2041
|
-
const revision = summaryPage.revision;
|
|
2042
|
-
if (summary.revision !== revision) throw new Error("Document projection revision drifted");
|
|
2043
|
-
if (summary.blockCount > DOCUMENT_MAX_BLOCKS) {
|
|
2044
|
-
throw new Error(`Document exceeds the interactive limit of ${DOCUMENT_MAX_BLOCKS} blocks`);
|
|
2045
|
-
}
|
|
2046
|
-
if (summary.sectionCount > DOCUMENT_MAX_SECTIONS) {
|
|
2047
|
-
throw new Error(`Document exceeds the interactive limit of ${DOCUMENT_MAX_SECTIONS} sections`);
|
|
2048
|
-
}
|
|
2049
|
-
if (summary.commentCount + summary.trackedChangeCount > DOCUMENT_MAX_REVIEW_ITEMS) {
|
|
2050
|
-
throw new Error(
|
|
2051
|
-
`Document exceeds the interactive limit of ${DOCUMENT_MAX_REVIEW_ITEMS} review items`
|
|
2052
|
-
);
|
|
2053
|
-
}
|
|
2054
|
-
const body = await collectDocumentPages(
|
|
2055
|
-
session,
|
|
2056
|
-
"body",
|
|
2057
|
-
revision,
|
|
2058
|
-
DOCUMENT_MAX_BLOCKS,
|
|
2059
|
-
DOCUMENT_MAX_TEXT_UTF16,
|
|
2060
|
-
DOCUMENT_MAX_TABLE_CELLS,
|
|
2061
|
-
(cursor, limits) => ({ kind: "body", startBlock: cursor, limits })
|
|
2062
|
-
);
|
|
2063
|
-
const sections = await collectDocumentPages(
|
|
2064
|
-
session,
|
|
2065
|
-
"sections",
|
|
2066
|
-
revision,
|
|
2067
|
-
DOCUMENT_MAX_SECTIONS,
|
|
2068
|
-
DOCUMENT_MAX_TEXT_UTF16 - body.text,
|
|
2069
|
-
DOCUMENT_MAX_TABLE_CELLS - body.cells,
|
|
2070
|
-
(cursor, limits) => ({ kind: "sections", startSection: cursor, limits })
|
|
2071
|
-
);
|
|
2072
|
-
const review = await collectDocumentPages(
|
|
2073
|
-
session,
|
|
2074
|
-
"review",
|
|
2075
|
-
revision,
|
|
2076
|
-
DOCUMENT_MAX_REVIEW_ITEMS,
|
|
2077
|
-
DOCUMENT_MAX_TEXT_UTF16 - body.text - sections.text,
|
|
2078
|
-
DOCUMENT_MAX_TABLE_CELLS - body.cells - sections.cells,
|
|
2079
|
-
(cursor, limits) => ({ kind: "review", startItem: cursor, limits })
|
|
2080
|
-
);
|
|
2081
|
-
if (body.items.length !== summary.blockCount) {
|
|
2082
|
-
throw new Error("Document body changed while it was opening");
|
|
2083
|
-
}
|
|
2084
|
-
if (sections.items.length !== summary.sectionCount) {
|
|
2085
|
-
throw new Error("Document sections changed while they were opening");
|
|
2086
|
-
}
|
|
2087
|
-
if (review.items.length !== summary.commentCount + summary.trackedChangeCount) {
|
|
2088
|
-
throw new Error("Document review state changed while it was opening");
|
|
2089
|
-
}
|
|
2090
|
-
const totalText = body.text + sections.text + review.text;
|
|
2091
|
-
const totalCells = body.cells + sections.cells + review.cells;
|
|
2092
|
-
if (totalText > DOCUMENT_MAX_TEXT_UTF16) {
|
|
2093
|
-
throw new Error(
|
|
2094
|
-
`Document exceeds the interactive limit of ${DOCUMENT_MAX_TEXT_UTF16} UTF-16 text units`
|
|
2095
|
-
);
|
|
2096
|
-
}
|
|
2097
|
-
if (totalCells > DOCUMENT_MAX_TABLE_CELLS) {
|
|
2098
|
-
throw new Error(
|
|
2099
|
-
`Document exceeds the interactive limit of ${DOCUMENT_MAX_TABLE_CELLS} table cells`
|
|
2100
|
-
);
|
|
2101
|
-
}
|
|
2102
|
-
return Object.freeze({
|
|
2103
|
-
revision: revision.toString(),
|
|
2104
|
-
page: projectDocumentPage(summary.page),
|
|
2105
|
-
blocks: Object.freeze(body.items.map(projectDocumentBlock)),
|
|
2106
|
-
sections: Object.freeze(sections.items.map(projectDocumentSection)),
|
|
2107
|
-
comments: Object.freeze(
|
|
2108
|
-
review.items.filter(isProjectionKind("comment")).map((item) => ({
|
|
2109
|
-
id: item.id,
|
|
2110
|
-
blockId: item.paragraphId,
|
|
2111
|
-
start: item.range.start,
|
|
2112
|
-
end: item.range.end,
|
|
2113
|
-
resolved: item.resolved,
|
|
2114
|
-
replies: item.replies.map((reply) => ({ ...reply }))
|
|
2115
|
-
}))
|
|
2116
|
-
),
|
|
2117
|
-
changes: Object.freeze(
|
|
2118
|
-
review.items.filter(isProjectionKind("tracked-change")).map((item) => ({
|
|
2119
|
-
id: item.id,
|
|
2120
|
-
blockId: item.paragraphId,
|
|
2121
|
-
kind: item.changeKind,
|
|
2122
|
-
start: item.range.start,
|
|
2123
|
-
end: item.range.end,
|
|
2124
|
-
author: item.author,
|
|
2125
|
-
createdAt: item.createdAt
|
|
2126
|
-
}))
|
|
2127
|
-
)
|
|
2128
|
-
});
|
|
2129
|
-
}
|
|
2130
|
-
async function collectDocumentPages(session, label, revision, maxItems, maxText, maxCells, query) {
|
|
2131
|
-
const output = { items: [], text: 0, cells: 0 };
|
|
2132
|
-
let cursor = 0;
|
|
2133
|
-
for (let pageIndex = 0; pageIndex < DOCUMENT_MAX_QUERY_PAGES; pageIndex += 1) {
|
|
2134
|
-
if (output.items.length >= maxItems && cursor > 0) {
|
|
2135
|
-
throw new Error(`Document ${label} exceeds its interactive item limit`);
|
|
2136
|
-
}
|
|
2137
|
-
const page = await session.queryDocument(
|
|
2138
|
-
query(cursor, {
|
|
2139
|
-
maxItems: Math.min(DOCUMENT_PAGE_ITEMS, Math.max(1, maxItems - output.items.length)),
|
|
2140
|
-
maxTextUtf16: Math.max(1, maxText - output.text),
|
|
2141
|
-
maxTableCells: Math.max(1, maxCells - output.cells)
|
|
2142
|
-
})
|
|
2143
|
-
);
|
|
2144
|
-
assertDocumentRevision(page, revision);
|
|
2145
|
-
assertDocumentPageKinds(label, page.items);
|
|
2146
|
-
if (output.items.length + page.items.length > maxItems) {
|
|
2147
|
-
throw new Error(`Document ${label} exceeds its interactive item limit`);
|
|
2148
|
-
}
|
|
2149
|
-
output.items.push(...page.items);
|
|
2150
|
-
output.text += page.projectedTextUtf16;
|
|
2151
|
-
output.cells += page.projectedTableCells;
|
|
2152
|
-
if (output.text > maxText || output.cells > maxCells) {
|
|
2153
|
-
throw new Error(`Document ${label} exceeds its interactive content limit`);
|
|
2154
|
-
}
|
|
2155
|
-
if (page.nextCursor === null) return output;
|
|
2156
|
-
if (page.nextCursor <= cursor || page.items.length === 0) {
|
|
2157
|
-
throw new Error(`Document ${label} pagination did not advance`);
|
|
2158
|
-
}
|
|
2159
|
-
cursor = page.nextCursor;
|
|
2160
|
-
}
|
|
2161
|
-
throw new Error(`Document ${label} exceeds ${DOCUMENT_MAX_QUERY_PAGES} query pages`);
|
|
2162
|
-
}
|
|
2163
|
-
function summaryItem(projection) {
|
|
2164
|
-
if (projection.items.length !== 1 || projection.items[0]?.kind !== "summary" || projection.nextCursor !== null || projection.truncated) {
|
|
2165
|
-
throw new Error("Document summary projection is malformed");
|
|
2166
|
-
}
|
|
2167
|
-
return projection.items[0];
|
|
2168
|
-
}
|
|
2169
|
-
function assertDocumentRevision(page, revision) {
|
|
2170
|
-
if (page.revision !== revision) throw new Error("Document projection revision drifted");
|
|
2171
|
-
}
|
|
2172
|
-
function assertDocumentPageKinds(label, items) {
|
|
2173
|
-
const valid = label === "body" ? /* @__PURE__ */ new Set(["paragraph", "table", "page-break"]) : label === "sections" ? /* @__PURE__ */ new Set(["section"]) : /* @__PURE__ */ new Set(["comment", "tracked-change"]);
|
|
2174
|
-
if (items.some((item) => !valid.has(item.kind))) {
|
|
2175
|
-
throw new Error(`Document ${label} projection contains an unexpected item`);
|
|
2176
|
-
}
|
|
2177
|
-
}
|
|
2178
|
-
function projectDocumentBlock(item) {
|
|
2179
|
-
if (item.kind === "paragraph") {
|
|
2180
|
-
const { headingLevel, list, ...paragraphStyle } = item.style;
|
|
2181
|
-
return {
|
|
2182
|
-
kind: "paragraph",
|
|
2183
|
-
id: item.id,
|
|
2184
|
-
runs: item.runs.map((run) => ({ text: run.text, style: { ...run.style } })),
|
|
2185
|
-
style: {
|
|
2186
|
-
...paragraphStyle,
|
|
2187
|
-
...headingLevel === void 0 ? {} : { headingLevel: documentHeadingLevel(headingLevel) },
|
|
2188
|
-
...list ? {
|
|
2189
|
-
list: {
|
|
2190
|
-
kind: list.kind,
|
|
2191
|
-
...list.level === null ? {} : { level: list.level },
|
|
2192
|
-
...list.instanceId === null ? {} : { instanceId: list.instanceId }
|
|
2193
|
-
}
|
|
2194
|
-
} : {}
|
|
2195
|
-
}
|
|
2196
|
-
};
|
|
2197
|
-
}
|
|
2198
|
-
if (item.kind === "table") {
|
|
2199
|
-
return {
|
|
2200
|
-
kind: "table",
|
|
2201
|
-
id: item.id,
|
|
2202
|
-
rows: item.rows.map(
|
|
2203
|
-
(row) => row.map((cell) => cell.map((run) => ({ text: run.text, style: { ...run.style } })))
|
|
2204
|
-
),
|
|
2205
|
-
style: { ...item.style }
|
|
2206
|
-
};
|
|
2207
|
-
}
|
|
2208
|
-
if (item.kind === "page-break") return { kind: "pageBreak", id: item.id };
|
|
2209
|
-
throw new Error("Document body projection contains an unexpected item");
|
|
2210
|
-
}
|
|
2211
|
-
function documentHeadingLevel(value) {
|
|
2212
|
-
if (value < 1 || value > 6 || !Number.isInteger(value)) {
|
|
2213
|
-
throw new Error("Document projection contains an invalid heading level");
|
|
2214
|
-
}
|
|
2215
|
-
return value;
|
|
2216
|
-
}
|
|
2217
|
-
function projectDocumentSection(item) {
|
|
2218
|
-
if (item.kind !== "section") {
|
|
2219
|
-
throw new Error("Document section projection contains an unexpected item");
|
|
2220
|
-
}
|
|
2221
|
-
return {
|
|
2222
|
-
id: item.id,
|
|
2223
|
-
startBlockIndex: item.startBlockIndex,
|
|
2224
|
-
page: projectDocumentPage(item.page),
|
|
2225
|
-
titlePage: item.titlePage,
|
|
2226
|
-
headerBlockCounts: item.headerBlockCounts,
|
|
2227
|
-
footerBlockCounts: item.footerBlockCounts
|
|
2228
|
-
};
|
|
2229
|
-
}
|
|
2230
|
-
function projectDocumentPage(page) {
|
|
2231
|
-
const points = (value) => Number(value) / 1e3;
|
|
2232
|
-
return {
|
|
2233
|
-
widthPt: points(page.widthMillipoints),
|
|
2234
|
-
heightPt: points(page.heightMillipoints),
|
|
2235
|
-
marginTopPt: points(page.marginTopMillipoints),
|
|
2236
|
-
marginRightPt: points(page.marginRightMillipoints),
|
|
2237
|
-
marginBottomPt: points(page.marginBottomMillipoints),
|
|
2238
|
-
marginLeftPt: points(page.marginLeftMillipoints),
|
|
2239
|
-
headerPt: points(page.headerMillipoints),
|
|
2240
|
-
footerPt: points(page.footerMillipoints),
|
|
2241
|
-
gutterPt: points(page.gutterMillipoints)
|
|
2242
|
-
};
|
|
2243
|
-
}
|
|
2244
|
-
function isProjectionKind(kind) {
|
|
2245
|
-
return (item) => item.kind === kind;
|
|
2246
|
-
}
|
|
2247
|
-
function paragraphTextById(projection) {
|
|
2248
|
-
return new Map(
|
|
2249
|
-
projection.blocks.filter((block) => block.kind === "paragraph").map((paragraph) => [paragraph.id, paragraph.runs.map((run) => run.text).join("")])
|
|
2250
|
-
);
|
|
2251
|
-
}
|
|
2252
|
-
function minimalUtf16TextEdit(before, after) {
|
|
2253
|
-
if (before === after) return null;
|
|
2254
|
-
let start = 0;
|
|
2255
|
-
const maximumStart = Math.min(before.length, after.length);
|
|
2256
|
-
while (start < maximumStart && before.charCodeAt(start) === after.charCodeAt(start)) start += 1;
|
|
2257
|
-
while (start > 0 && (splitsSurrogate(before, start) || splitsSurrogate(after, start))) start -= 1;
|
|
2258
|
-
let suffix = 0;
|
|
2259
|
-
while (suffix < before.length - start && suffix < after.length - start && before.charCodeAt(before.length - suffix - 1) === after.charCodeAt(after.length - suffix - 1)) {
|
|
2260
|
-
suffix += 1;
|
|
2261
|
-
}
|
|
2262
|
-
while (suffix > 0 && (splitsSurrogate(before, before.length - suffix) || splitsSurrogate(after, after.length - suffix))) {
|
|
2263
|
-
suffix -= 1;
|
|
2264
|
-
}
|
|
2265
|
-
return {
|
|
2266
|
-
range: { start, end: before.length - suffix },
|
|
2267
|
-
replacement: after.slice(start, after.length - suffix)
|
|
2268
|
-
};
|
|
2269
|
-
}
|
|
2270
|
-
function splitsSurrogate(value, index) {
|
|
2271
|
-
if (index <= 0 || index >= value.length) return false;
|
|
2272
|
-
const left = value.charCodeAt(index - 1);
|
|
2273
|
-
const right = value.charCodeAt(index);
|
|
2274
|
-
return left >= 55296 && left <= 56319 && right >= 56320 && right <= 57343;
|
|
2275
|
-
}
|
|
2276
|
-
function documentTextStylePatch(style) {
|
|
2277
|
-
return {
|
|
2278
|
-
...style.fontFamily === void 0 ? {} : { fontFamily: style.fontFamily },
|
|
2279
|
-
...style.fontSizePt === void 0 ? {} : { fontSizePt: style.fontSizePt },
|
|
2280
|
-
...style.color === void 0 ? {} : { color: style.color },
|
|
2281
|
-
...style.bold === void 0 ? {} : { bold: style.bold },
|
|
2282
|
-
...style.italic === void 0 ? {} : { italic: style.italic },
|
|
2283
|
-
...style.underline === void 0 ? {} : { underline: style.underline },
|
|
2284
|
-
...style.strike === void 0 ? {} : { strike: style.strike }
|
|
2285
|
-
};
|
|
2286
|
-
}
|
|
2287
|
-
function isRevisionDrift(error) {
|
|
2288
|
-
return error.message.includes("changed while") || error.message.includes("revision drifted");
|
|
2289
|
-
}
|
|
2290
|
-
function notifyDocumentCommit(t, observer, onError, commit) {
|
|
2291
|
-
try {
|
|
2292
|
-
const result = observer?.(commit);
|
|
2293
|
-
if (result && typeof result.then === "function") {
|
|
2294
|
-
void Promise.resolve(result).catch(
|
|
2295
|
-
(cause) => onError?.(
|
|
2296
|
-
asEditableArtifactError(
|
|
2297
|
-
cause,
|
|
2298
|
-
t("artifacts.editableDocument.documentCommitObserverFailed")
|
|
2299
|
-
)
|
|
2300
|
-
)
|
|
2301
|
-
);
|
|
2302
|
-
}
|
|
2303
|
-
} catch (cause) {
|
|
2304
|
-
onError?.(
|
|
2305
|
-
asEditableArtifactError(cause, t("artifacts.editableDocument.documentCommitObserverFailed"))
|
|
2306
|
-
);
|
|
2307
|
-
}
|
|
2308
|
-
}
|
|
2309
|
-
|
|
2310
|
-
export {
|
|
2311
|
-
DocumentEditor,
|
|
2312
|
-
DocumentProjectionEditor,
|
|
2313
|
-
DocumentArtifactSurface,
|
|
2314
|
-
DocumentProjectionArtifactSurface,
|
|
2315
|
-
EditableDocumentArtifactSurface
|
|
2316
|
-
};
|
|
2317
|
-
//# sourceMappingURL=chunk-TLR2SX7T.js.map
|