@arbidocs/blocks 0.5.134 → 0.5.136
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/{ConnectedNativeDocxComparison-H72RQJKH.cjs → ConnectedNativeDocxComparison-W4KIGO54.cjs} +8 -8
- package/dist/{ConnectedNativeDocxComparison-H72RQJKH.cjs.map → ConnectedNativeDocxComparison-W4KIGO54.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-T7PZIRBY.cjs → ConnectedStreamedWordArtifact-764NSXPQ.cjs} +8 -8
- package/dist/{ConnectedStreamedWordArtifact-T7PZIRBY.cjs.map → ConnectedStreamedWordArtifact-764NSXPQ.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-EM2AJUF3.cjs → DocumentReviewCard-UV3DLFCB.cjs} +3 -3
- package/dist/{DocumentReviewCard-EM2AJUF3.cjs.map → DocumentReviewCard-UV3DLFCB.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-PA2B7O7I.cjs → FilesViewerDialog-IFF2JR2A.cjs} +6 -6
- package/dist/{FilesViewerDialog-PA2B7O7I.cjs.map → FilesViewerDialog-IFF2JR2A.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-XZAEU5QU.cjs → NativeDocxEditor-KM6U4ZLA.cjs} +6 -6
- package/dist/{NativeDocxEditor-XZAEU5QU.cjs.map → NativeDocxEditor-KM6U4ZLA.cjs.map} +1 -1
- package/dist/{chunk-T2DUNNYY.cjs → chunk-C6DF6WB2.cjs} +745 -21
- package/dist/chunk-C6DF6WB2.cjs.map +1 -0
- package/dist/{chunk-64247UHS.cjs → chunk-DBGBAD4J.cjs} +4 -4
- package/dist/{chunk-64247UHS.cjs.map → chunk-DBGBAD4J.cjs.map} +1 -1
- package/dist/{chunk-UOZ237OW.cjs → chunk-FABKMTAI.cjs} +42 -5
- package/dist/chunk-FABKMTAI.cjs.map +1 -0
- package/dist/{chunk-L4Y6UMRC.cjs → chunk-FDRZJFNV.cjs} +5 -5
- package/dist/{chunk-L4Y6UMRC.cjs.map → chunk-FDRZJFNV.cjs.map} +1 -1
- package/dist/{chunk-O5WVYUFT.cjs → chunk-IEAZX7L6.cjs} +4 -4
- package/dist/{chunk-O5WVYUFT.cjs.map → chunk-IEAZX7L6.cjs.map} +1 -1
- package/dist/{chunk-2SWS7ESM.cjs → chunk-L62EU3TQ.cjs} +3 -3
- package/dist/{chunk-2SWS7ESM.cjs.map → chunk-L62EU3TQ.cjs.map} +1 -1
- package/dist/{chunk-IN3KXI3K.cjs → chunk-LG36LSVZ.cjs} +6 -6
- package/dist/{chunk-IN3KXI3K.cjs.map → chunk-LG36LSVZ.cjs.map} +1 -1
- package/dist/{chunk-RZSBHRQL.cjs → chunk-MMKMQZ2B.cjs} +5 -5
- package/dist/{chunk-RZSBHRQL.cjs.map → chunk-MMKMQZ2B.cjs.map} +1 -1
- package/dist/chunk-MMMGOZYH.cjs +18 -0
- package/dist/{chunk-KWD5Q4XH.cjs.map → chunk-MMMGOZYH.cjs.map} +1 -1
- package/dist/{chunk-V6SFJ44C.cjs → chunk-ZN2JXV65.cjs} +50 -13
- package/dist/chunk-ZN2JXV65.cjs.map +1 -0
- package/dist/connect/docx.cjs +12 -12
- package/dist/connect/index.cjs +86 -86
- package/dist/connect/viewer.cjs +4 -4
- package/dist/connection/docx/ConnectedNativeDocxEditor.js +39 -2
- package/dist/connection/docx/ConnectedNativeDocxEditor.js.map +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js +43 -6
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/docx/NativeDocxEditor.d.ts +12 -1
- package/dist/docx/NativeDocxEditor.js +513 -20
- package/dist/docx/NativeDocxEditor.js.map +3 -3
- package/dist/docx/index.cjs +38 -38
- package/dist/docx/recoveryStore.d.ts +8 -0
- package/dist/docx/recoveryStore.js +208 -0
- package/dist/docx/recoveryStore.js.map +7 -0
- package/dist/docx/temporaryRecovery.d.ts +8 -0
- package/dist/docx/temporaryRecovery.js +37 -0
- package/dist/docx/temporaryRecovery.js.map +7 -0
- package/dist/index.cjs +72 -72
- package/dist/styles.css +1 -1
- package/dist/vite/index.cjs +11 -1
- package/dist/vite/index.cjs.map +1 -1
- package/dist/vite/index.d.ts +13 -0
- package/dist/vite/index.js +11 -1
- package/dist/vite/index.js.map +1 -1
- package/dist/workflow-canvas/index.cjs +10 -10
- package/node_modules/@arbidocs/coedit/dist/commands.cjs +18 -1
- package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/commands.d.cts +2 -2
- package/node_modules/@arbidocs/coedit/dist/commands.d.ts +2 -2
- package/node_modules/@arbidocs/coedit/dist/commands.js +18 -1
- package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/{port-BbN5OZHx.d.cts → port-DXBNxZYw.d.cts} +2 -0
- package/node_modules/@arbidocs/coedit/dist/{port-BbN5OZHx.d.ts → port-DXBNxZYw.d.ts} +2 -0
- package/node_modules/@arbidocs/coedit/dist/server.cjs +16 -0
- package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
- package/node_modules/@arbidocs/coedit/dist/server.js +16 -0
- package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +2 -2
- package/node_modules/@docx-editor.dev/core/README.md +25 -1
- package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +1 -0
- package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +21 -63
- package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +49 -40
- package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{chrome-print-CAs51cpq.d.ts → chrome-print-CrPI9ZQc.d.ts} +714 -290
- package/node_modules/@docx-editor.dev/core/dist/chunk-23MKR33J.js +4 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2CWQY27B.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2DEY5NUC.cjs +32 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2DR4TH6B.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2F2UEAE2.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-2GPGAFOJ.cjs +5 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ALD626VU.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-AU33YWEJ.js +236 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-AXU63LYW.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-CM5VZRBV.js +32 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-D7FAFFTN.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-DYUVJNDD.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ESYUKD5D.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-F7TGQMVR.js +5 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-FLW7KIQX.js +30 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-JG4A6W6I.js +7 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-JNGLSBPH.js +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-KE6ZWRIY.cjs +236 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-L3YXJDPX.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-LI42N7OW.cjs +4 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-PLKDS4JT.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-PXMTQ73F.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-R4R3AAE4.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-RFUNFTGV.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-SVM6PGMS.js +3 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-SZURLHR3.cjs +3 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-UYCGCVZ2.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-WN7ICTA5.js +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-X34QRAUU.cjs +1 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-XNBYG4XJ.cjs +30 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ZDFJW5XS.cjs +2 -0
- package/node_modules/@docx-editor.dev/core/dist/chunk-ZWO4JHNN.cjs +7 -0
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +29 -5
- package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +5 -6
- package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +3 -3
- package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +13 -10
- package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +2 -2
- package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +15 -13
- package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +135 -2
- package/node_modules/@docx-editor.dev/core/dist/{custom-node-writes-Bn6uciLb.d.ts → custom-node-writes-AqY5KpVx.d.ts} +7 -2
- package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-CuzhOX0g.d.ts +98 -0
- package/node_modules/@docx-editor.dev/core/dist/{diagnostic-hints-BeVjfNOv.d.ts → diagnostic-hints-BtCaCqQC.d.ts} +14 -7
- package/node_modules/@docx-editor.dev/core/dist/{document-protection-CUb55pl_.d.ts → document-protection-BvbpSXbQ.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/drawing-graphic-kind-CXYGYbB3.d.ts +324 -0
- package/node_modules/@docx-editor.dev/core/dist/drawing-preview-package-B9lSLRg4.d.ts +115 -0
- package/node_modules/@docx-editor.dev/core/dist/{editor-CZQZmTIU.d.ts → editor-B7OOAAie.d.ts} +536 -283
- package/node_modules/@docx-editor.dev/core/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
- package/node_modules/@docx-editor.dev/core/dist/editor-scope-CA6egMaK.d.ts +141 -0
- package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/editor.css +6 -4
- package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +834 -34
- package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -2
- package/node_modules/@docx-editor.dev/core/dist/export.d.ts +52 -21
- package/node_modules/@docx-editor.dev/core/dist/export.js +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{font-resolver-lSBLirLR.d.ts → font-resolver-Bm9XqTNO.d.ts} +15 -1
- package/node_modules/@docx-editor.dev/core/dist/font-shaping-policy-BvpkrfxM.d.ts +7 -0
- package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/index.d.ts +44 -27
- package/node_modules/@docx-editor.dev/core/dist/index.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{layout-shaping-BD-dF_rn.d.ts → layout-shaping-Ci_BTnSU.d.ts} +3 -2
- package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +276 -126
- package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/metafile-drawing-DtMFyMKq.d.ts +107 -0
- package/node_modules/@docx-editor.dev/core/dist/{note-properties-qQUjO1GQ.d.ts → note-properties-DCIJUKIy.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/output.d.ts +24 -10
- package/node_modules/@docx-editor.dev/core/dist/output.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{protocol-DYzzz2ej.d.ts → protocol-Cp_QzVxS.d.ts} +167 -5
- package/node_modules/@docx-editor.dev/core/dist/{review-paragraph-order-CN_0l2Cb.d.ts → review-paragraph-order-BJQ43_r0.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/revision-projection-OVusTS77.d.ts +258 -0
- package/node_modules/@docx-editor.dev/core/dist/{semantic-cell-selection-eYag3P47.d.ts → semantic-cell-selection-CoI5hHBm.d.ts} +2 -2
- package/node_modules/@docx-editor.dev/core/dist/{semantic-interaction-kR_QB845.d.ts → semantic-interaction-BbA4dgEo.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-paint-ZayFF3tD.d.ts → semantic-paint-B5JcIv9c.d.ts} +19 -9
- package/node_modules/@docx-editor.dev/core/dist/{semantic-record-queries-Bsgth6lv.d.ts → semantic-record-queries-DnO8J5_j.d.ts} +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{semantic-records-DQmumPgL.d.ts → semantic-records-DoK0lNjS.d.ts} +697 -608
- package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -1
- package/node_modules/@docx-editor.dev/core/dist/store.d.ts +527 -123
- package/node_modules/@docx-editor.dev/core/dist/store.js +1 -1
- package/node_modules/@docx-editor.dev/core/dist/{types-barrel-DuC5QBNC.d.ts → tree-op-types-Df4oY2u4.d.ts} +1723 -765
- package/node_modules/@docx-editor.dev/core/dist/{tree-package-store-CovjNARF.d.ts → tree-package-store-DXhX1PE-.d.ts} +617 -428
- package/node_modules/@docx-editor.dev/core/dist/{tree-session-contract-CZVAGl51.d.ts → tree-session-contract-CF2625mv.d.ts} +28 -13
- package/node_modules/@docx-editor.dev/core/dist/unsupported-elements-CUojsaCr.d.ts +23 -0
- package/node_modules/@docx-editor.dev/core/docs/accept-reject-without-scrolling.md +95 -0
- package/node_modules/@docx-editor.dev/core/docs/comment-on-found-text.md +72 -0
- package/node_modules/@docx-editor.dev/core/docs/custom-review-cards.md +178 -0
- package/node_modules/@docx-editor.dev/core/docs/highlight-ranges.md +48 -0
- package/node_modules/@docx-editor.dev/core/docs/index.md +36 -0
- package/node_modules/@docx-editor.dev/core/docs/propose-rewrite.md +247 -0
- package/node_modules/@docx-editor.dev/core/docs/tracked-replacement.md +68 -0
- package/node_modules/@docx-editor.dev/core/licenses/ECMA-376.md +29 -0
- package/node_modules/@docx-editor.dev/core/package.json +3 -2
- package/node_modules/@docx-editor.dev/react/README.md +71 -0
- package/node_modules/@docx-editor.dev/react/dist/index.d.mts +936 -86
- package/node_modules/@docx-editor.dev/react/dist/index.d.ts +936 -86
- package/node_modules/@docx-editor.dev/react/dist/index.js +3 -3
- package/node_modules/@docx-editor.dev/react/dist/index.mjs +3 -3
- package/node_modules/@docx-editor.dev/react/docs/accept-reject-without-scrolling.md +72 -0
- package/node_modules/@docx-editor.dev/react/docs/comment-on-found-text.md +47 -0
- package/node_modules/@docx-editor.dev/react/docs/custom-review-cards.md +105 -0
- package/node_modules/@docx-editor.dev/react/docs/highlight-ranges.md +25 -0
- package/node_modules/@docx-editor.dev/react/docs/index.md +36 -0
- package/node_modules/@docx-editor.dev/react/docs/propose-rewrite.md +247 -0
- package/node_modules/@docx-editor.dev/react/docs/tracked-replacement.md +45 -0
- package/node_modules/@docx-editor.dev/react/package.json +4 -3
- package/package.json +8 -8
- package/src/docx/styles.css +37 -7
- package/dist/chunk-KWD5Q4XH.cjs +0 -18
- package/dist/chunk-T2DUNNYY.cjs.map +0 -1
- package/dist/chunk-UOZ237OW.cjs.map +0 -1
- package/dist/chunk-V6SFJ44C.cjs.map +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-236O4YQW.js +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-6JPL6ZAS.cjs +0 -5
- package/node_modules/@docx-editor.dev/core/dist/chunk-6ZQP4HQ7.js +0 -3
- package/node_modules/@docx-editor.dev/core/dist/chunk-7WQ7AAHW.cjs +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-BCXH4BXB.js +0 -5
- package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-BY2ACZZ6.cjs +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-CAJEXXVG.cjs +0 -4
- package/node_modules/@docx-editor.dev/core/dist/chunk-CPWLFPWC.js +0 -30
- package/node_modules/@docx-editor.dev/core/dist/chunk-D7ZMDMPX.cjs +0 -3
- package/node_modules/@docx-editor.dev/core/dist/chunk-DOHF6FA7.cjs +0 -30
- package/node_modules/@docx-editor.dev/core/dist/chunk-DVX32P2P.js +0 -27
- package/node_modules/@docx-editor.dev/core/dist/chunk-E4LOMDNL.js +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-EKLM7NWB.cjs +0 -7
- package/node_modules/@docx-editor.dev/core/dist/chunk-G3K63G7P.cjs +0 -27
- package/node_modules/@docx-editor.dev/core/dist/chunk-G4HOFIKJ.js +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-JLVBDYVQ.cjs +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-LQX36Z5P.js +0 -7
- package/node_modules/@docx-editor.dev/core/dist/chunk-LSZ6KPKK.js +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-MM5QBMTE.cjs +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-OMCG63ZF.js +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-OSFOJTHU.cjs +0 -18
- package/node_modules/@docx-editor.dev/core/dist/chunk-RCLZXP3B.js +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-T6K2QYNZ.cjs +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-TRGAVV2Y.js +0 -4
- package/node_modules/@docx-editor.dev/core/dist/chunk-U4JZVSOE.js +0 -2
- package/node_modules/@docx-editor.dev/core/dist/chunk-UHHYFIDT.cjs +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-W35WTWAO.cjs +0 -1
- package/node_modules/@docx-editor.dev/core/dist/chunk-YQ5G6LC7.js +0 -18
- package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-B8M79cfK.d.ts +0 -30
- package/node_modules/@docx-editor.dev/core/dist/editor-scope-7o9xweiJ.d.ts +0 -84
- package/node_modules/@docx-editor.dev/core/dist/headless-document-view-pp3q7wIh.d.ts +0 -143
- package/node_modules/@docx-editor.dev/core/dist/image-resources-tXLQShoC.d.ts +0 -211
- package/node_modules/@docx-editor.dev/core/dist/omml-equation-BUbU0utM.d.ts +0 -85
package/dist/connect/viewer.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkZN2JXV65_cjs = require('../chunk-ZN2JXV65.cjs');
|
|
5
5
|
require('../chunk-JITYC4OS.cjs');
|
|
6
6
|
require('../chunk-WVZLAAIZ.cjs');
|
|
7
7
|
require('../chunk-X7ALF4MP.cjs');
|
|
@@ -17,7 +17,7 @@ require('../chunk-HYUKPHCT.cjs');
|
|
|
17
17
|
require('../chunk-FYFL3CET.cjs');
|
|
18
18
|
require('../chunk-223D4727.cjs');
|
|
19
19
|
require('../chunk-SNUBQMIS.cjs');
|
|
20
|
-
require('../chunk-
|
|
20
|
+
require('../chunk-FABKMTAI.cjs');
|
|
21
21
|
require('../chunk-4ONPEVTP.cjs');
|
|
22
22
|
require('../chunk-V3KLUWQQ.cjs');
|
|
23
23
|
require('../chunk-OA3AN6WW.cjs');
|
|
@@ -43,7 +43,7 @@ require('../chunk-SK6HQ46Q.cjs');
|
|
|
43
43
|
require('../chunk-MNIQDXM6.cjs');
|
|
44
44
|
require('../chunk-T6WA6S5T.cjs');
|
|
45
45
|
require('../chunk-TG2GM7WJ.cjs');
|
|
46
|
-
require('../chunk-
|
|
46
|
+
require('../chunk-L62EU3TQ.cjs');
|
|
47
47
|
require('../chunk-OEJQFPWO.cjs');
|
|
48
48
|
require('../chunk-OYXWQTHF.cjs');
|
|
49
49
|
require('../chunk-S237ORM3.cjs');
|
|
@@ -94,7 +94,7 @@ require('../chunk-PLIF5CUV.cjs');
|
|
|
94
94
|
|
|
95
95
|
Object.defineProperty(exports, "ConnectedDocumentViewer", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkZN2JXV65_cjs.ConnectedDocumentViewer; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "ConnectedDocumentToolsProvider", {
|
|
100
100
|
enumerable: true,
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { saveNativeVersion } from "./save-native-version.js";
|
|
4
4
|
import { useMemo, useRef, useState } from "react";
|
|
5
|
+
import { getUserEncryptionKeypair } from "@arbidocs/client";
|
|
5
6
|
import { useQueryClient } from "@tanstack/react-query";
|
|
6
|
-
import { refreshDocuments, useArbi, useWorkspaceUsers } from "@arbidocs/react";
|
|
7
|
+
import { refreshDocuments, useArbi, useArbiSessionStore, useWorkspaceUsers } from "@arbidocs/react";
|
|
7
8
|
import {
|
|
8
9
|
fetchSavedSignature,
|
|
9
10
|
storeSavedSignature,
|
|
@@ -73,7 +74,8 @@ function tokenChanges(arbi) {
|
|
|
73
74
|
}
|
|
74
75
|
function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
|
|
75
76
|
const arbi = useArbi();
|
|
76
|
-
const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace();
|
|
77
|
+
const { workspaceId, userId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace();
|
|
78
|
+
const sessionStore = useArbiSessionStore();
|
|
77
79
|
const queries = useQueryClient();
|
|
78
80
|
const { notify } = useBlocksEnvironment();
|
|
79
81
|
const tools = useOptionalDocumentTools();
|
|
@@ -86,8 +88,39 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
|
|
|
86
88
|
});
|
|
87
89
|
const onDocumentsChanged = tools?.onDocumentsChanged;
|
|
88
90
|
const author = live && arbi.user.profile()?.givenName || user?.name || "You";
|
|
91
|
+
const recoveryOrigin = arbi.getConnectionInfo()?.baseUrl || window.location.origin;
|
|
89
92
|
const adapter = useMemo(
|
|
90
93
|
() => ({
|
|
94
|
+
recoveryScope: workspaceId && userId ? `${recoveryOrigin}\0${workspaceId}\0${userId}` : void 0,
|
|
95
|
+
recoveryIsCurrent: () => arbi.isLoggedIn && !!workspaceId && !!userId && (arbi.getConnectionInfo()?.baseUrl || window.location.origin) === recoveryOrigin && sessionStore.getState().workspaceId === workspaceId && arbi.user.identity()?.externalId === userId,
|
|
96
|
+
onRecoveryInvalidated: (listener) => {
|
|
97
|
+
if (!arbi.isLoggedIn) return () => {
|
|
98
|
+
};
|
|
99
|
+
const auth = arbi.getClient().session;
|
|
100
|
+
const check = () => {
|
|
101
|
+
const state = auth.getState();
|
|
102
|
+
if (!state.signedIn || state.userExtId !== userId || sessionStore.getState().workspaceId !== workspaceId)
|
|
103
|
+
listener();
|
|
104
|
+
};
|
|
105
|
+
const stopAuth = auth.subscribe(check), stopWorkspace = sessionStore.subscribe(check);
|
|
106
|
+
check();
|
|
107
|
+
return () => {
|
|
108
|
+
stopAuth();
|
|
109
|
+
stopWorkspace();
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
recoveryIdentity: async () => {
|
|
113
|
+
const before = arbi.user.identity()?.externalId;
|
|
114
|
+
if (!arbi.isLoggedIn || !workspaceId || !userId || before !== userId || (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin || sessionStore.getState().workspaceId !== workspaceId)
|
|
115
|
+
return null;
|
|
116
|
+
const keypair = await getUserEncryptionKeypair();
|
|
117
|
+
if (!keypair) return null;
|
|
118
|
+
if (!arbi.isLoggedIn || arbi.user.identity()?.externalId !== before || (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin || sessionStore.getState().workspaceId !== workspaceId) {
|
|
119
|
+
keypair.secretKey.fill(0);
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
return { workspaceId: JSON.stringify([recoveryOrigin, workspaceId]), keypair };
|
|
123
|
+
},
|
|
91
124
|
request: async (path, options) => {
|
|
92
125
|
await ensureWorkspaceOpen();
|
|
93
126
|
return arbi.editor.request(path, options);
|
|
@@ -164,6 +197,10 @@ function useConnectedNativeDocxAdapter(fontBaseUrl = "/native-docx/fonts") {
|
|
|
164
197
|
support,
|
|
165
198
|
references,
|
|
166
199
|
houseTemplate,
|
|
200
|
+
workspaceId,
|
|
201
|
+
recoveryOrigin,
|
|
202
|
+
userId,
|
|
203
|
+
sessionStore,
|
|
167
204
|
user?.name
|
|
168
205
|
]
|
|
169
206
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/connection/docx/ConnectedNativeDocxEditor.tsx"],
|
|
4
|
-
"sourcesContent": ["import { saveNativeVersion } from './save-native-version'\nimport { useMemo, useRef, useState } from 'react'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport type { NativeDocxAdapter, NativeDocxEditorProps } from '../../docx/NativeDocxEditor'\nimport { NativeDocxEditor } from '../../docx/lazy'\nimport { registerDocumentTurnFlush } from '@arbidocs/react'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter' | 'compact'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: (id, state, autosave) => saveNativeVersion(arbi.editor.request, id, state, autosave),\n loadFonts: () => import('../../docx/fonts').then((m) => m.loadDocxFonts(fontBaseUrl)),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n registerTurnFlush: registerDocumentTurnFlush,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id, version) => {\n if (onDocumentsChanged) await onDocumentsChanged([id], 'version')\n if (version || !onDocumentsChanged) {\n const fresh = await refreshDocuments(queries, arbi, [id])\n if (\n version &&\n !fresh.some((doc) => doc.external_id === id && (doc.current_version ?? 0) >= version)\n ) {\n throw new Error(\n 'The version was saved, but its current status could not be confirmed. Please try again.'\n )\n }\n }\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n user?.name,\n ]\n )\n return adapter\n}\n"],
|
|
5
|
-
"mappings": ";
|
|
4
|
+
"sourcesContent": ["import { saveNativeVersion } from './save-native-version'\nimport { useMemo, useRef, useState } from 'react'\nimport { getUserEncryptionKeypair } from '@arbidocs/client'\nimport { useQueryClient } from '@tanstack/react-query'\nimport { refreshDocuments, useArbi, useArbiSessionStore, useWorkspaceUsers } from '@arbidocs/react'\nimport {\n fetchSavedSignature,\n storeSavedSignature,\n useOptionalDocumentTools,\n} from '@arbidocs/react/document-tools'\nimport type { NativeDocxAdapter, NativeDocxEditorProps } from '../../docx/NativeDocxEditor'\nimport { NativeDocxEditor } from '../../docx/lazy'\nimport { registerDocumentTurnFlush } from '@arbidocs/react'\nimport { useRegisterOpenDocument } from '@arbidocs/react/shell'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { useConnectedWorkspace } from '../ConnectionProvider'\nimport { useDocxCommentTarget, useNativeDocxSupport } from './support'\nimport { useConnectedDocxReferences } from './useConnectedDocxReferences'\nimport { useConnectedHouseTemplate } from './useConnectedHouseTemplate'\n\nexport type ConnectedNativeDocxEditorProps = Omit<NativeDocxEditorProps, 'adapter' | 'compact'> & {\n fontBaseUrl?: string\n}\n\n/**\n * The native Word editor on the signed-in ARBI session, under any host (`defaultHost`'s sign-in\n * layer, or the host's own `arbi` and session state). Until a live session has opened, a failure to\n * open one falls back to the saved copy, read-only, so the document is still readable; later token\n * refreshes are not guarded (switching modes would drop unsaved edits).\n */\nexport function ConnectedNativeDocxEditor({\n fontBaseUrl = '/native-docx/fonts',\n ...props\n}: ConnectedNativeDocxEditorProps) {\n const adapter = useConnectedNativeDocxAdapter(fontBaseUrl)\n const { workspaceId } = useConnectedWorkspace()\n const commentTarget = useDocxCommentTarget()\n const [openFailed, setOpenFailed] = useState(false)\n const hasOpened = useRef(false)\n const guardedAdapter = useMemo<NativeDocxAdapter>(\n () => ({\n ...adapter,\n open: async (documentId) => {\n try {\n const session = await adapter.open(documentId)\n hasOpened.current = true\n return session\n } catch (error) {\n if (!hasOpened.current) setOpenFailed(true)\n throw error\n }\n },\n }),\n [adapter]\n )\n // Drafting mode: the saved Word document being edited is what the chat is about. A history\n // snapshot, a streamed preview, an unsaved draft and an embedded body field are not.\n const live = !props.snapshot && !props.stream && !props.draftContent\n useRegisterOpenDocument({ documentId: live ? props.documentId : null, workspaceId })\n const initialCommentId =\n props.initialCommentId ??\n (commentTarget?.documentId === props.documentId ? commentTarget.commentId : undefined)\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {openFailed && (\n <p role=\"status\" className=\"text-muted-foreground border-b px-3 py-2 text-xs\">\n Co-editing isn't available for this document right now, so this is a read-only copy\n of the last saved version.\n </p>\n )}\n <div className=\"min-h-0 flex-1\">\n <NativeDocxEditor\n {...props}\n snapshot={props.snapshot || openFailed}\n initialCommentId={initialCommentId}\n adapter={guardedAdapter}\n />\n </div>\n </div>\n )\n}\n\n/** The access token changed (a refresh): the live room is told the new one. */\nfunction tokenChanges(arbi: ReturnType<typeof useArbi>) {\n return (listener: () => void) => {\n if (!arbi.isLoggedIn) return () => {}\n const session = arbi.getClient().session\n let token = session.getState().accessToken\n return session.subscribe((state) => {\n if (state.accessToken === token) return\n token = state.accessToken\n listener()\n })\n }\n}\n\n/**\n * The native Word adapter on the signed-in session: the editor transport, the people to mention,\n * cross-references, the house template, and the host's extras (its host config's `docx`).\n */\nexport function useConnectedNativeDocxAdapter(fontBaseUrl = '/native-docx/fonts') {\n const arbi = useArbi()\n const { workspaceId, userId, live, user, ensureWorkspaceOpen } = useConnectedWorkspace()\n const sessionStore = useArbiSessionStore()\n const queries = useQueryClient()\n const { notify } = useBlocksEnvironment()\n const tools = useOptionalDocumentTools()\n const support = useNativeDocxSupport()\n const references = useConnectedDocxReferences()\n const houseTemplate = useConnectedHouseTemplate()\n const { data: members } = useWorkspaceUsers(workspaceId ?? undefined, {\n enabled: live && !!workspaceId,\n beforeFetch: ensureWorkspaceOpen,\n })\n const onDocumentsChanged = tools?.onDocumentsChanged\n // Tracked changes and comments are authored by the user's first name.\n const author = (live && arbi.user.profile()?.givenName) || user?.name || 'You'\n const recoveryOrigin = arbi.getConnectionInfo()?.baseUrl || window.location.origin\n const adapter = useMemo<NativeDocxAdapter>(\n () => ({\n recoveryScope:\n workspaceId && userId ? `${recoveryOrigin}\\0${workspaceId}\\0${userId}` : undefined,\n recoveryIsCurrent: () =>\n arbi.isLoggedIn &&\n !!workspaceId &&\n !!userId &&\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) === recoveryOrigin &&\n sessionStore.getState().workspaceId === workspaceId &&\n arbi.user.identity()?.externalId === userId,\n onRecoveryInvalidated: (listener) => {\n if (!arbi.isLoggedIn) return () => {}\n const auth = arbi.getClient().session\n const check = () => {\n const state = auth.getState()\n if (\n !state.signedIn ||\n state.userExtId !== userId ||\n sessionStore.getState().workspaceId !== workspaceId\n )\n listener()\n }\n const stopAuth = auth.subscribe(check),\n stopWorkspace = sessionStore.subscribe(check)\n check()\n return () => {\n stopAuth()\n stopWorkspace()\n }\n },\n recoveryIdentity: async () => {\n const before = arbi.user.identity()?.externalId\n if (\n !arbi.isLoggedIn ||\n !workspaceId ||\n !userId ||\n before !== userId ||\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin ||\n sessionStore.getState().workspaceId !== workspaceId\n )\n return null\n const keypair = await getUserEncryptionKeypair()\n if (!keypair) return null\n if (\n !arbi.isLoggedIn ||\n arbi.user.identity()?.externalId !== before ||\n (arbi.getConnectionInfo()?.baseUrl || window.location.origin) !== recoveryOrigin ||\n sessionStore.getState().workspaceId !== workspaceId\n ) {\n keypair.secretKey.fill(0)\n return null\n }\n return { workspaceId: JSON.stringify([recoveryOrigin, workspaceId]), keypair }\n },\n request: async (path, options) => {\n await ensureWorkspaceOpen()\n return arbi.editor.request(path, options)\n },\n open: async (id) => {\n await ensureWorkspaceOpen()\n return (\n await arbi.editor.request(`/${encodeURIComponent(id)}/session`, { method: 'POST' })\n ).json()\n },\n save: (id, state, autosave) => saveNativeVersion(arbi.editor.request, id, state, autosave),\n loadFonts: () => import('../../docx/fonts').then((m) => m.loadDocxFonts(fontBaseUrl)),\n baseUrl: arbi.getConnectionInfo()?.baseUrl || window.location.origin,\n author,\n subscribeTokenChanges: tokenChanges(arbi),\n onDirtyChange: support.onDirtyChange,\n registerTurnFlush: registerDocumentTurnFlush,\n // The document's row moves to the saved version in place: through the host when it keeps\n // the lists (its document tools refresh them), else here.\n onVersionSaved: async (id, version) => {\n if (onDocumentsChanged) await onDocumentsChanged([id], 'version')\n if (version || !onDocumentsChanged) {\n const fresh = await refreshDocuments(queries, arbi, [id])\n if (\n version &&\n !fresh.some((doc) => doc.external_id === id && (doc.current_version ?? 0) >= version)\n ) {\n throw new Error(\n 'The version was saved, but its current status could not be confirmed. Please try again.'\n )\n }\n }\n },\n notify,\n mentions: members?.map(({ user: member }) => ({\n id: member.external_id,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n kind: member.external_id.startsWith('agt-') ? 'agent' : 'human',\n })),\n savedSignature: {\n load: () => fetchSavedSignature(arbi.getClient().fetch),\n save: (signature) => storeSavedSignature(arbi.getClient().fetch, signature),\n defaultName: user?.name ?? '',\n },\n signatureSigners: members\n ?.filter(({ user: member }) => member.external_id.startsWith('usr-'))\n .map(({ user: member }) => ({\n email: member.email,\n name: [member.given_name, member.family_name].filter(Boolean).join(' '),\n })),\n requestAgent: async (id, request) => {\n const response = await arbi.editor.request(`/${encodeURIComponent(id)}/mentions`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({\n comment_id: request.commentId,\n instruction: request.instruction,\n request_id: request.requestId,\n recipient_ids: request.recipientIds,\n }),\n })\n const delivery = (await response.json()) as { response_ids: string[] }\n notify('Mention delivered.', 'success')\n return { responseIds: delivery.response_ids || [] }\n },\n getAgentStatus: async (responseId) => (await arbi.assistant.getResponse(responseId)).status,\n definitions: support.definitions,\n references,\n imageGeneration: support.imageGeneration,\n houseTemplate,\n }),\n [\n arbi,\n author,\n members,\n ensureWorkspaceOpen,\n fontBaseUrl,\n queries,\n notify,\n onDocumentsChanged,\n support,\n references,\n houseTemplate,\n workspaceId,\n recoveryOrigin,\n userId,\n sessionStore,\n user?.name,\n ]\n )\n return adapter\n}\n"],
|
|
5
|
+
"mappings": ";AA+DI,SAEI,KAFJ;AA/DJ,SAAS,yBAAyB;AAClC,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAAS,gCAAgC;AACzC,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB,SAAS,qBAAqB,yBAAyB;AAClF;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,wBAAwB;AACjC,SAAS,iCAAiC;AAC1C,SAAS,+BAA+B;AACxC,SAAS,4BAA4B;AACrC,SAAS,6BAA6B;AACtC,SAAS,sBAAsB,4BAA4B;AAC3D,SAAS,kCAAkC;AAC3C,SAAS,iCAAiC;AAYnC,SAAS,0BAA0B;AAAA,EACxC,cAAc;AAAA,EACd,GAAG;AACL,GAAmC;AACjC,QAAM,UAAU,8BAA8B,WAAW;AACzD,QAAM,EAAE,YAAY,IAAI,sBAAsB;AAC9C,QAAM,gBAAgB,qBAAqB;AAC3C,QAAM,CAAC,YAAY,aAAa,IAAI,SAAS,KAAK;AAClD,QAAM,YAAY,OAAO,KAAK;AAC9B,QAAM,iBAAiB;AAAA,IACrB,OAAO;AAAA,MACL,GAAG;AAAA,MACH,MAAM,OAAO,eAAe;AAC1B,YAAI;AACF,gBAAM,UAAU,MAAM,QAAQ,KAAK,UAAU;AAC7C,oBAAU,UAAU;AACpB,iBAAO;AAAA,QACT,SAAS,OAAO;AACd,cAAI,CAAC,UAAU,QAAS,eAAc,IAAI;AAC1C,gBAAM;AAAA,QACR;AAAA,MACF;AAAA,IACF;AAAA,IACA,CAAC,OAAO;AAAA,EACV;AAGA,QAAM,OA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iBAAiB,QAAQ;AAAA,MACzB;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AACA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -113,7 +113,30 @@ const NativeDocxComparison = lazy(
|
|
|
113
113
|
const UPLOADED_NO_VERSIONS = "No earlier versions yet. Replacing, editing or signing this file adds a new version here.";
|
|
114
114
|
function ConnectedDocumentViewer(props) {
|
|
115
115
|
const viewing = useArbiSessionState((s) => s.viewingDocument?.id);
|
|
116
|
-
const
|
|
116
|
+
const requestedId = props.documentId ?? viewing;
|
|
117
|
+
const session = useArbiSessionStore();
|
|
118
|
+
const leaveWordRef = useRef(null);
|
|
119
|
+
const [openedId, setOpenedId] = useState(requestedId);
|
|
120
|
+
useEffect(() => {
|
|
121
|
+
if (requestedId === openedId) return;
|
|
122
|
+
let cancelled = false;
|
|
123
|
+
void (async () => {
|
|
124
|
+
const guard = leaveWordRef.current;
|
|
125
|
+
let result = false;
|
|
126
|
+
try {
|
|
127
|
+
result = guard ? await guard() : "unchanged";
|
|
128
|
+
} catch {
|
|
129
|
+
result = false;
|
|
130
|
+
}
|
|
131
|
+
if (cancelled) return;
|
|
132
|
+
if (result) setOpenedId(requestedId);
|
|
133
|
+
else if (props.documentId === void 0 && openedId)
|
|
134
|
+
session.setViewingDocument({ id: openedId });
|
|
135
|
+
})();
|
|
136
|
+
return () => {
|
|
137
|
+
cancelled = true;
|
|
138
|
+
};
|
|
139
|
+
}, [requestedId, openedId, props.documentId, session]);
|
|
117
140
|
if (!openedId) return null;
|
|
118
141
|
return /* @__PURE__ */ jsx(
|
|
119
142
|
ErrorBoundary,
|
|
@@ -121,12 +144,13 @@ function ConnectedDocumentViewer(props) {
|
|
|
121
144
|
resetKey: openedId,
|
|
122
145
|
labels: { title: "This document couldn't be displayed" },
|
|
123
146
|
testId: "document-viewer-error",
|
|
124
|
-
children: /* @__PURE__ */ jsx(ConnectedDocumentToolsProvider, { children: /* @__PURE__ */ jsx(DocumentViewerContent, { ...props, openedId }) })
|
|
147
|
+
children: /* @__PURE__ */ jsx(ConnectedDocumentToolsProvider, { children: /* @__PURE__ */ jsx(DocumentViewerContent, { ...props, openedId, leaveWordRef }) })
|
|
125
148
|
}
|
|
126
149
|
);
|
|
127
150
|
}
|
|
128
151
|
function DocumentViewerContent({
|
|
129
152
|
openedId,
|
|
153
|
+
leaveWordRef,
|
|
130
154
|
headerActions,
|
|
131
155
|
artifactRuntimeUrl = "/artifact-runtime/"
|
|
132
156
|
}) {
|
|
@@ -247,7 +271,7 @@ function DocumentViewerContent({
|
|
|
247
271
|
},
|
|
248
272
|
[]
|
|
249
273
|
);
|
|
250
|
-
const requestViewerTransition = async (transition) => {
|
|
274
|
+
const requestViewerTransition = async (transition, allowLocalRecovery = false) => {
|
|
251
275
|
if (transitionPending.current) return false;
|
|
252
276
|
const leavingWord = isDocx && !isDraft && !isStreaming && !snapshotDocumentId && (activeTab === "docx" || isArtifact && !liveKind && activeTab === "edit");
|
|
253
277
|
if (leavingWord) {
|
|
@@ -256,6 +280,17 @@ function DocumentViewerContent({
|
|
|
256
280
|
try {
|
|
257
281
|
const saved = saveWordRef.current && await saveWordRef.current();
|
|
258
282
|
if (!saved) {
|
|
283
|
+
const local = allowLocalRecovery && leaveWordRef.current && await leaveWordRef.current();
|
|
284
|
+
if (local) {
|
|
285
|
+
if (generation !== transitionScope.current.generation) return false;
|
|
286
|
+
if (local === "saved")
|
|
287
|
+
notify(
|
|
288
|
+
"A local recovery copy was saved. It has not been saved as a document version.",
|
|
289
|
+
"success"
|
|
290
|
+
);
|
|
291
|
+
transition();
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
259
294
|
notify("Could not save the current document. Stay in the editor and try again.", "error");
|
|
260
295
|
return false;
|
|
261
296
|
}
|
|
@@ -270,7 +305,7 @@ function DocumentViewerContent({
|
|
|
270
305
|
};
|
|
271
306
|
const handleTabChange = (tab) => {
|
|
272
307
|
if (tab === activeTab) return;
|
|
273
|
-
void requestViewerTransition(() => changeTab(tab));
|
|
308
|
+
void requestViewerTransition(() => changeTab(tab), tab === "versions");
|
|
274
309
|
};
|
|
275
310
|
const crop = useImageCrop(
|
|
276
311
|
documentId,
|
|
@@ -405,7 +440,7 @@ function DocumentViewerContent({
|
|
|
405
440
|
setSnapshotDocumentId(id === currentVersionId ? null : id);
|
|
406
441
|
if (activeTab === "versions")
|
|
407
442
|
setActiveTab(isArtifact ? "edit" : isDocx ? "docx" : "pdf");
|
|
408
|
-
});
|
|
443
|
+
}, true);
|
|
409
444
|
},
|
|
410
445
|
onHistory: () => handleTabChange("versions")
|
|
411
446
|
}
|
|
@@ -815,6 +850,7 @@ function DocumentViewerContent({
|
|
|
815
850
|
draftContent: isDraft ? draftDoc?.content || "" : void 0,
|
|
816
851
|
snapshot: !!snapshotDocumentId,
|
|
817
852
|
saveRef: saveWordRef,
|
|
853
|
+
leaveRef: leaveWordRef,
|
|
818
854
|
onSaved: (id) => {
|
|
819
855
|
if (!isDraft) return;
|
|
820
856
|
session.clearDraftDocument(documentId);
|
|
@@ -870,7 +906,8 @@ function DocumentViewerContent({
|
|
|
870
906
|
documentId: snapshotDocumentId || documentId,
|
|
871
907
|
title: documentTitle,
|
|
872
908
|
snapshot: !!snapshotDocumentId,
|
|
873
|
-
saveRef: saveWordRef
|
|
909
|
+
saveRef: saveWordRef,
|
|
910
|
+
leaveRef: leaveWordRef
|
|
874
911
|
},
|
|
875
912
|
`${snapshotDocumentId || documentId}-${snapshotDocumentId ? "snapshot" : "live"}`
|
|
876
913
|
)
|