codex-overleaf-link 2.4.1 → 2.5.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/README.md +272 -314
- package/README.zh-CN.md +287 -329
- package/extension/bootstrap/background.js +47 -10
- package/extension/bootstrap/manifest.template.json +9 -4
- package/extension/bootstrap/popup.html +10 -16
- package/extension/bootstrap/update.js +25 -2
- package/extension/runtime-manifest.json +3 -1
- package/extension/src/background.js +28 -3
- package/extension/src/backgroundSharedSessions.js +380 -0
- package/extension/src/backgroundUpdateCoordinator.js +442 -379
- package/extension/src/content/activeTurnControl.js +8 -0
- package/extension/src/content/assetTransferBroker.js +186 -12
- package/extension/src/content/changeHistoryView.js +175 -0
- package/extension/src/content/composerAttachments.js +24 -22
- package/extension/src/content/composerPanel.js +23 -8
- package/extension/src/content/contentRuntime.js +507 -507
- package/extension/src/content/diagnosticsController.js +1 -2
- package/extension/src/content/diagnosticsExport.js +222 -0
- package/extension/src/content/diagnosticsPanel.js +48 -19
- package/extension/src/content/diffReviewPanel.js +8 -5
- package/extension/src/content/generated/content.bundle.js +8330 -1349
- package/extension/src/content/generated/content.bundle.meta.json +22 -3
- package/extension/src/content/legacyGlobalRegistry.js +19 -1
- package/extension/src/content/localSkillsPanel.js +42 -7
- package/extension/src/content/markdownDomRenderer.js +9 -4
- package/extension/src/content/modelPicker.js +1 -1
- package/extension/src/content/pageBridgeClient.js +18 -3
- package/extension/src/content/panelMaintenance.js +48 -121
- package/extension/src/content/panelRenderer.js +4 -0
- package/extension/src/content/pendingInputView.js +109 -76
- package/extension/src/content/providerSettingsCoordinator.js +17 -6
- package/extension/src/content/providerSettingsDialog.js +661 -108
- package/extension/src/content/recentProjects.js +10 -1
- package/extension/src/content/runActivitySummary.js +631 -0
- package/extension/src/content/runController.js +3 -1
- package/extension/src/content/runFailureNotice.js +14 -1
- package/extension/src/content/runGuidanceController.js +4 -3
- package/extension/src/content/runPresence.js +306 -0
- package/extension/src/content/runQueueScheduler.js +2 -1
- package/extension/src/content/runResultActions.js +123 -3
- package/extension/src/content/runTimelineView.js +186 -154
- package/extension/src/content/selectionContextView.js +300 -0
- package/extension/src/content/sessionPersistence.js +6 -1
- package/extension/src/content/settingsPanel.js +77 -52
- package/extension/src/content/settingsWorkbench.js +374 -0
- package/extension/src/content/sharedSessionViewSync.js +72 -0
- package/extension/src/content/subagentActivityView.js +195 -0
- package/extension/src/content/trackedChangeCaptureController.js +7 -3
- package/extension/src/content/updateNotice.js +121 -50
- package/extension/src/content/writebackController.js +257 -0
- package/extension/src/content/writebackOrchestrator.js +146 -141
- package/extension/src/content/writebackPlan.js +231 -0
- package/extension/src/content/writebackRecovery.js +122 -0
- package/extension/src/content/writingStyleSettings.js +576 -0
- package/extension/src/content/writtenChangesView.js +152 -0
- package/extension/src/page/binaryAssetUploader.js +97 -19
- package/extension/src/page/overleafProjectSnapshot.js +1 -0
- package/extension/src/page/referenceProjects.js +148 -0
- package/extension/src/page/saveState.js +14 -2
- package/extension/src/page/snapshotRouter.js +44 -13
- package/extension/src/page/textCoordinates.js +102 -0
- package/extension/src/page/textFileCreator.js +350 -59
- package/extension/src/page/trackedChangeCapture.js +42 -56
- package/extension/src/page/trackedChangeOwnership.js +198 -0
- package/extension/src/page/trackedChangeReplay.js +164 -0
- package/extension/src/page/trackedChangesLifecycle.js +135 -149
- package/extension/src/page/treeOperations.js +26 -2
- package/extension/src/page/writebackReceiptJournal.js +112 -0
- package/extension/src/page/writebackRouter.js +175 -135
- package/extension/src/pageBridge.js +56 -101
- package/extension/src/popup.js +203 -59
- package/extension/src/shared/agentTranscript.js +18 -4
- package/extension/src/shared/auditRecords.js +71 -0
- package/extension/src/shared/changeHistoryModel.js +94 -0
- package/extension/src/shared/compatibility.js +1 -1
- package/extension/src/shared/compileAdapter.js +42 -0
- package/extension/src/shared/failureReasons.js +20 -0
- package/extension/src/shared/globalPreferences.js +1 -1
- package/extension/src/shared/i18n.js +93 -25
- package/extension/src/shared/managedUpdateProjection.js +6 -3
- package/extension/src/shared/pageRpcContract.js +7 -1
- package/extension/src/shared/providerProfiles.js +109 -0
- package/extension/src/shared/runActivityModel.js +361 -0
- package/extension/src/shared/runExecutionSnapshot.js +8 -2
- package/extension/src/shared/runExecutionSnapshotCodec.js +16 -4
- package/extension/src/shared/scopedPersistenceBrowserAdapter.js +6 -3
- package/extension/src/shared/selectionContext.js +28 -0
- package/extension/src/shared/sessionState.js +97 -6
- package/extension/src/shared/sharedSessionBridge.js +288 -0
- package/extension/src/shared/storageDb.js +22 -55
- package/extension/src/shared/storageMigration.js +3 -0
- package/extension/src/shared/storageRunActions.js +10 -4
- package/extension/src/shared/storageValuePruning.js +40 -0
- package/extension/src/shared/subagentActivityModel.js +174 -0
- package/extension/src/shared/undoOperations.js +87 -0
- package/extension/src/shared/updateConsent.js +37 -8
- package/extension/src/shared/writebackIntent.js +62 -0
- package/extension/src/shared/writebackSettlement.js +29 -10
- package/extension/src/shared/writingStyle.js +33 -0
- package/extension/styles/panel.css +1972 -384
- package/extension/styles/popup.css +110 -0
- package/native-host/src/anthropicBridgeRequest.js +2 -1
- package/native-host/src/codexModelRecovery.js +107 -0
- package/native-host/src/codexPromptAssembly.js +2 -0
- package/native-host/src/codexProviderLaunch.js +3 -3
- package/native-host/src/codexRuntimeIdentity.js +1 -0
- package/native-host/src/codexSessionRunner.js +106 -140
- package/native-host/src/codexSessionTiming.js +3 -0
- package/native-host/src/managedInstall.js +5 -4
- package/native-host/src/nativeEnvironment.js +70 -0
- package/native-host/src/nativeQuotas.js +15 -8
- package/native-host/src/overleafWorkspaceRules.js +16 -0
- package/native-host/src/processStopBarrier.js +80 -0
- package/native-host/src/providerModelCatalog.js +4 -3
- package/native-host/src/providerProfile.js +13 -1
- package/native-host/src/providerReasoning.js +9 -5
- package/native-host/src/providerStore.js +4 -0
- package/native-host/src/releaseTransport.js +14 -5
- package/native-host/src/selectionScope.js +58 -0
- package/native-host/src/skills/parallel-subagents/SKILL.md +31 -3
- package/native-host/src/skills/writing-style-builder/SKILL.md +146 -0
- package/native-host/src/subagentBroker.js +102 -98
- package/native-host/src/subagentTelemetry.js +316 -0
- package/native-host/src/subagentWorkspace.js +103 -0
- package/native-host/src/subagentWorkspacePath.js +31 -0
- package/native-host/src/taskRunnerRuntime.js +55 -5
- package/native-host/src/turnAttachments.js +113 -0
- package/native-host/src/updateManager.js +122 -12
- package/native-host/src/updateNetworkControl.js +75 -0
- package/native-host/src/updateTrust.js +21 -2
- package/native-host/src/vendor/pdfjs/LICENSE +177 -0
- package/native-host/src/vendor/pdfjs/SOURCE.txt +3 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78ms-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/78ms-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/83pv-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90ms-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90ms-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90msp-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90msp-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90pv-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/90pv-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Add-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-3.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-4.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-5.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-6.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-CNS1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-3.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-4.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-5.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-GB1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-3.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-4.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-5.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-6.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Japan1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-0.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-1.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Adobe-Korea1-UCS2.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5pc-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/B5pc-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS1-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS1-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/CNS2-V.bcmap +3 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETHK-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETHK-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETen-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETen-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETenms-B5-H.bcmap +3 -0
- package/native-host/src/vendor/pdfjs/cmaps/ETenms-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Ext-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-H.bcmap +4 -0
- package/native-host/src/vendor/pdfjs/cmaps/GB-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK2K-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBK2K-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBKp-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBKp-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBT-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBTpc-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBTpc-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBpc-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/GBpc-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdla-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdla-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdlb-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKdlb-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKgccs-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKgccs-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm314-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm314-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm471-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKm471-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKscs-B5-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/HKscs-B5-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Hankaku.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Hiragana.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-Johab-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-Johab-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-HW-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-HW-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCms-UHC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCpc-EUC-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/KSCpc-EUC-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Katakana.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/LICENSE +36 -0
- package/native-host/src/vendor/pdfjs/cmaps/NWP-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/NWP-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/RKSJ-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/RKSJ-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/Roman.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniCNS-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniGB-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-HW-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJIS2004-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISPro-UCS2-HW-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISPro-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISPro-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX0213-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX0213-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniJISX02132004-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UCS2-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UCS2-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF16-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF16-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF32-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF32-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF8-H.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/UniKS-UTF8-V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/V.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/cmaps/WP-Symbol.bcmap +0 -0
- package/native-host/src/vendor/pdfjs/pdf.mjs +26740 -0
- package/native-host/src/vendor/pdfjs/pdf.worker.mjs +62201 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitDingbats.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixed.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixedBold.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixedBoldItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitFixedItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerif.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerifBold.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerifBoldItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSerifItalic.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/FoxitSymbol.pfb +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LICENSE_FOXIT +27 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LICENSE_LIBERATION +102 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-Bold.ttf +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-Italic.ttf +0 -0
- package/native-host/src/vendor/pdfjs/standard_fonts/LiberationSans-Regular.ttf +0 -0
- package/native-host/src/writingStyleEvidence.js +102 -0
- package/native-host/src/writingStylePdfWorker.js +35 -0
- package/native-host/src/writingStyleProfile.js +165 -0
- package/native-host/src/writingStyleRuntime.js +447 -0
- package/package.json +1 -1
|
@@ -86,8 +86,7 @@
|
|
|
86
86
|
title: tr('diagnosticsHealthTitle'),
|
|
87
87
|
subtitle: tr(overallSubtitleKey),
|
|
88
88
|
status: worst === 'ok' ? 'completed' : worst === 'fail' ? 'failed' : 'warning',
|
|
89
|
-
checks
|
|
90
|
-
technical: checks.map(check => `${check.title}: ${check.status}`).join('\n')
|
|
89
|
+
checks
|
|
91
90
|
});
|
|
92
91
|
setDiagnosticsHealth(worst);
|
|
93
92
|
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
(function (root, factory) {
|
|
2
|
+
if (typeof module === 'object' && module.exports) module.exports = factory();
|
|
3
|
+
else root.CodexOverleafModuleRegistry.define('DiagnosticsExport', [], factory);
|
|
4
|
+
})(typeof globalThis !== 'undefined' ? globalThis : this, function () {
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
function create(deps = {}) {
|
|
8
|
+
const { root, window, document, Blob, URL, TextEncoder, AuditRecords, StorageDb, CodexOverleafCompatibility, getState, getCurrentRunView, getCurrentProjectId, findRunRecord, getMirrorFreshness, getExtensionCompatibilityMetadata, getModelDiscovery, getGovernanceRulesForCurrentProject, sendBackgroundNative, fallbackNativeCompatibility, isNativeCompatibilityCompatible, getNativeCompatibilityClassification, callPageBridge, showPluginToast, tr, RUN_SNAPSHOT_ZIP_TIMEOUT_MS } = deps;
|
|
9
|
+
|
|
10
|
+
function exposeSmokeHelper() {
|
|
11
|
+
const helper = Object.freeze({
|
|
12
|
+
probeNative: smokeProbeNative,
|
|
13
|
+
probeProject: smokeProbeProject,
|
|
14
|
+
getProjectSnapshotMetrics: smokeProbeProject
|
|
15
|
+
});
|
|
16
|
+
try {
|
|
17
|
+
Object.defineProperty(root, 'CodexOverleafSmoke', {
|
|
18
|
+
configurable: true,
|
|
19
|
+
enumerable: false,
|
|
20
|
+
value: helper
|
|
21
|
+
});
|
|
22
|
+
} catch (_error) {
|
|
23
|
+
root.CodexOverleafSmoke = helper;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function smokeProbeNative() {
|
|
28
|
+
try {
|
|
29
|
+
const params = CodexOverleafCompatibility?.buildBridgePingParams
|
|
30
|
+
? CodexOverleafCompatibility.buildBridgePingParams(getExtensionCompatibilityMetadata())
|
|
31
|
+
: {};
|
|
32
|
+
const response = await sendBackgroundNative({ method: 'bridge.ping', params });
|
|
33
|
+
const compatibility = CodexOverleafCompatibility?.evaluateNativeCompatibility
|
|
34
|
+
? CodexOverleafCompatibility.evaluateNativeCompatibility(response, getExtensionCompatibilityMetadata())
|
|
35
|
+
: fallbackNativeCompatibility(response);
|
|
36
|
+
return {
|
|
37
|
+
supported: true,
|
|
38
|
+
ok: response?.ok === true && isNativeCompatibilityCompatible(compatibility),
|
|
39
|
+
status: compatibility?.status || (response?.ok ? 'ok' : 'native_missing'),
|
|
40
|
+
classification: getNativeCompatibilityClassification(compatibility),
|
|
41
|
+
errorCode: response?.error?.code || compatibility?.status || '',
|
|
42
|
+
nativeCompatibility: summarizeSmokeNativeCompatibility(compatibility, response)
|
|
43
|
+
};
|
|
44
|
+
} catch (_error) {
|
|
45
|
+
return {
|
|
46
|
+
supported: true,
|
|
47
|
+
ok: false,
|
|
48
|
+
status: 'native_probe_failed',
|
|
49
|
+
errorCode: 'native_probe_failed'
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function smokeProbeProject(options = {}) {
|
|
55
|
+
try {
|
|
56
|
+
const project = await callPageBridge('getProjectSnapshot', {
|
|
57
|
+
force: Boolean(options.force),
|
|
58
|
+
preferLightweight: true,
|
|
59
|
+
allowZipFallback: true,
|
|
60
|
+
allowEditorNavigation: false,
|
|
61
|
+
requireFullProject: false,
|
|
62
|
+
includeBinaryFiles: true,
|
|
63
|
+
includeContent: false,
|
|
64
|
+
zipTimeoutMs: RUN_SNAPSHOT_ZIP_TIMEOUT_MS
|
|
65
|
+
});
|
|
66
|
+
const files = Array.isArray(project?.files) ? project.files : [];
|
|
67
|
+
const skipped = Array.isArray(project?.capabilities?.skipped) ? project.capabilities.skipped : [];
|
|
68
|
+
const bytes = summarizeSmokeProjectBytes(files);
|
|
69
|
+
const ok = project?.ok !== false && files.length > 0;
|
|
70
|
+
return {
|
|
71
|
+
supported: true,
|
|
72
|
+
ok,
|
|
73
|
+
status: ok ? 'ok' : 'project_snapshot_unavailable',
|
|
74
|
+
errorCode: ok ? '' : project?.code || 'project_snapshot_unavailable',
|
|
75
|
+
counts: {
|
|
76
|
+
files: files.length,
|
|
77
|
+
skipped: skipped.length
|
|
78
|
+
},
|
|
79
|
+
bytes,
|
|
80
|
+
method: project?.capabilities?.method || ''
|
|
81
|
+
};
|
|
82
|
+
} catch (_error) {
|
|
83
|
+
return {
|
|
84
|
+
supported: true,
|
|
85
|
+
ok: false,
|
|
86
|
+
status: 'project_probe_failed',
|
|
87
|
+
errorCode: 'project_probe_failed',
|
|
88
|
+
counts: {
|
|
89
|
+
files: 0,
|
|
90
|
+
skipped: 0
|
|
91
|
+
},
|
|
92
|
+
bytes: {
|
|
93
|
+
text: 0,
|
|
94
|
+
binary: 0
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function summarizeSmokeNativeCompatibility(compatibility = {}, response = {}) {
|
|
101
|
+
const native = compatibility?.native || response?.result || {};
|
|
102
|
+
return {
|
|
103
|
+
status: compatibility?.status || (response?.ok ? 'ok' : 'native_missing'),
|
|
104
|
+
classification: getNativeCompatibilityClassification(compatibility),
|
|
105
|
+
nativeVersion: compatibility?.nativeVersion || native.version || '',
|
|
106
|
+
version: compatibility?.version || native.version || '',
|
|
107
|
+
minimumNativeVersion: compatibility?.minimumNativeVersion || compatibility?.minNativeVersion || '',
|
|
108
|
+
protocolVersion: compatibility?.protocolVersion || native.protocolVersion || '',
|
|
109
|
+
supportedProtocol: compatibility?.supportedProtocol || native.supportedProtocol || ''
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function summarizeSmokeProjectBytes(files = []) {
|
|
114
|
+
return files.reduce((bytes, file) => {
|
|
115
|
+
let size = Number(file?.size || file?.byteLength || 0);
|
|
116
|
+
if ((!Number.isFinite(size) || size <= 0) && typeof file?.content === 'string') {
|
|
117
|
+
size = new TextEncoder().encode(file.content).byteLength;
|
|
118
|
+
}
|
|
119
|
+
if (!Number.isFinite(size) || size <= 0) {
|
|
120
|
+
return bytes;
|
|
121
|
+
}
|
|
122
|
+
if (file?.kind === 'binary') {
|
|
123
|
+
bytes.binary += size;
|
|
124
|
+
} else {
|
|
125
|
+
bytes.text += size;
|
|
126
|
+
}
|
|
127
|
+
return bytes;
|
|
128
|
+
}, {
|
|
129
|
+
text: 0,
|
|
130
|
+
binary: 0
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
async function exportDiagnosticsBundle() {
|
|
135
|
+
if (!AuditRecords?.buildDiagnosticBundle) {
|
|
136
|
+
throw new Error('Audit diagnostics helper is unavailable');
|
|
137
|
+
}
|
|
138
|
+
const projectId = getCurrentProjectId();
|
|
139
|
+
const currentRunView = getCurrentRunView();
|
|
140
|
+
const activeRecord = currentRunView && findRunRecord(currentRunView.recordId, currentRunView.sessionId);
|
|
141
|
+
const recentRuns = (getState().runs || []).filter(run => run && (!run.runProjectId || run.runProjectId === projectId))
|
|
142
|
+
.slice().reverse().sort((a, b) => (Date.parse(b.startedAt) || 0) - (Date.parse(a.startedAt) || 0)).slice(0, 8);
|
|
143
|
+
const [auditLogs, mirror, nativeDiagnostics] = await Promise.all([
|
|
144
|
+
getRecentAuditLogsForCurrentProject(),
|
|
145
|
+
getMirrorFreshness().catch(error => ({ status: 'unavailable', errorCode: error.message })),
|
|
146
|
+
getNativeDiagnosticsSummaryForBundle()
|
|
147
|
+
]);
|
|
148
|
+
if (getCurrentProjectId() !== projectId) throw new Error('Project changed during diagnostics export; export again.');
|
|
149
|
+
const bundle = AuditRecords.buildDiagnosticBundle({
|
|
150
|
+
excludeContent: true,
|
|
151
|
+
compatibility: {
|
|
152
|
+
extension: getExtensionCompatibilityMetadata(),
|
|
153
|
+
modelDiscovery: getModelDiscovery()
|
|
154
|
+
},
|
|
155
|
+
platform: nativeDiagnostics.platform,
|
|
156
|
+
nativeEnvironment: nativeDiagnostics.nativeEnvironment,
|
|
157
|
+
mirror,
|
|
158
|
+
auditLogs,
|
|
159
|
+
run: activeRecord?.runProjectId === projectId ? activeRecord : recentRuns[0] || {},
|
|
160
|
+
recentRuns,
|
|
161
|
+
governance: getGovernanceRulesForCurrentProject(),
|
|
162
|
+
projectId
|
|
163
|
+
});
|
|
164
|
+
const blob = new Blob([JSON.stringify(bundle, null, 2)], { type: 'application/json' });
|
|
165
|
+
const url = URL.createObjectURL(blob);
|
|
166
|
+
const link = document.createElement('a');
|
|
167
|
+
link.href = url;
|
|
168
|
+
link.download = `codex-overleaf-diagnostics-${new Date().toISOString().replace(/[:.]/g, '-')}.json`;
|
|
169
|
+
document.body.append(link);
|
|
170
|
+
link.click();
|
|
171
|
+
link.remove();
|
|
172
|
+
window.setTimeout(() => URL.revokeObjectURL(url), 1000);
|
|
173
|
+
showPluginToast(tr('diagnosticsExportDone'), { status: 'completed' });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async function getNativeDiagnosticsSummaryForBundle() {
|
|
177
|
+
try {
|
|
178
|
+
const params = CodexOverleafCompatibility?.buildBridgePingParams
|
|
179
|
+
? CodexOverleafCompatibility.buildBridgePingParams(getExtensionCompatibilityMetadata())
|
|
180
|
+
: {};
|
|
181
|
+
const response = await sendBackgroundNative({ method: 'bridge.ping', params });
|
|
182
|
+
if (!response?.ok) {
|
|
183
|
+
const errorCode = response?.error?.code || 'native_unavailable';
|
|
184
|
+
return {
|
|
185
|
+
platform: { status: 'unavailable', errorCode },
|
|
186
|
+
nativeEnvironment: { status: 'unavailable', errorCode }
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return {
|
|
190
|
+
platform: {
|
|
191
|
+
host: response.result?.host || '',
|
|
192
|
+
platform: response.result?.platform || '',
|
|
193
|
+
version: response.result?.version || '',
|
|
194
|
+
protocolVersion: response.result?.protocolVersion || ''
|
|
195
|
+
},
|
|
196
|
+
nativeEnvironment: response.result?.environment || {}
|
|
197
|
+
};
|
|
198
|
+
} catch (error) {
|
|
199
|
+
const errorCode = error?.message || 'native_unavailable';
|
|
200
|
+
return {
|
|
201
|
+
platform: { status: 'unavailable', errorCode },
|
|
202
|
+
nativeEnvironment: { status: 'unavailable', errorCode }
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async function getRecentAuditLogsForCurrentProject(limit = 12) {
|
|
208
|
+
if (!StorageDb?.getAllByIndex) {
|
|
209
|
+
return [];
|
|
210
|
+
}
|
|
211
|
+
const records = await StorageDb.getAllByIndex('auditLogs', 'projectId', getCurrentProjectId());
|
|
212
|
+
return (records || [])
|
|
213
|
+
.slice()
|
|
214
|
+
.sort((left, right) => String(right.createdAt || '').localeCompare(String(left.createdAt || '')))
|
|
215
|
+
.slice(0, limit);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return { exposeSmokeHelper, exportDiagnosticsBundle, smokeProbeNative, smokeProbeProject, summarizeSmokeProjectBytes };
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
return { create };
|
|
222
|
+
});
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
callbacks: options.callbacks || {},
|
|
12
12
|
i18n: options.i18n || {},
|
|
13
13
|
dismissInstalled: false,
|
|
14
|
+
resultDismissed: false,
|
|
14
15
|
cleanup: []
|
|
15
16
|
};
|
|
16
17
|
|
|
@@ -47,19 +48,21 @@
|
|
|
47
48
|
<small data-i18n="diagnosticsExportSubtitle">Redacted audit and environment bundle</small>
|
|
48
49
|
</button>
|
|
49
50
|
</div>
|
|
50
|
-
<section class="codex-diagnostics-result" data-diagnostics-result hidden>
|
|
51
|
+
<section class="codex-diagnostics-result" data-diagnostics-result role="region" aria-label="Diagnostics" hidden>
|
|
51
52
|
<div class="codex-diagnostics-result-head">
|
|
52
53
|
<div>
|
|
53
54
|
<div class="codex-diagnostics-result-title" data-diagnostics-result-title></div>
|
|
54
55
|
<div class="codex-diagnostics-result-subtitle" data-diagnostics-result-subtitle></div>
|
|
55
56
|
</div>
|
|
56
|
-
<button type="button" data-diagnostics-result-close title="Close" aria-label="Close diagnostics result"
|
|
57
|
+
<button type="button" data-diagnostics-result-close title="Close" aria-label="Close diagnostics result"><span class="codex-icon" aria-hidden="true"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="m4 4 8 8M12 4l-8 8"/></svg></span></button>
|
|
58
|
+
</div>
|
|
59
|
+
<div class="codex-diagnostics-result-scroll">
|
|
60
|
+
<div class="codex-diagnostics-result-body" data-diagnostics-result-body></div>
|
|
61
|
+
<details class="codex-diagnostics-technical" data-diagnostics-result-details>
|
|
62
|
+
<summary data-i18n="technicalDetails">Technical Details</summary>
|
|
63
|
+
<pre data-diagnostics-result-technical></pre>
|
|
64
|
+
</details>
|
|
57
65
|
</div>
|
|
58
|
-
<div class="codex-diagnostics-result-body" data-diagnostics-result-body></div>
|
|
59
|
-
<details class="codex-diagnostics-technical" data-diagnostics-result-details>
|
|
60
|
-
<summary data-i18n="technicalDetails">Technical Details</summary>
|
|
61
|
-
<pre data-diagnostics-result-technical></pre>
|
|
62
|
-
</details>
|
|
63
66
|
</section>
|
|
64
67
|
</div>
|
|
65
68
|
`;
|
|
@@ -85,7 +88,10 @@
|
|
|
85
88
|
root.querySelector('[data-diagnostics-snapshot]')?.addEventListener('click', () => instance.callbacks.onSnapshot?.());
|
|
86
89
|
root.querySelector('[data-diagnostics-ot]')?.addEventListener('click', () => instance.callbacks.onOtDiagnostics?.());
|
|
87
90
|
root.querySelector('[data-diagnostics-export]')?.addEventListener('click', () => instance.callbacks.onExport?.());
|
|
88
|
-
root.querySelector('[data-diagnostics-result-close]')?.addEventListener('click', () =>
|
|
91
|
+
root.querySelector('[data-diagnostics-result-close]')?.addEventListener('click', () => {
|
|
92
|
+
closeResult(instance);
|
|
93
|
+
root.querySelector('[data-diagnostics-menu]')?.focus();
|
|
94
|
+
});
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
function toggleMenu(target, forceOpen) {
|
|
@@ -95,8 +101,14 @@
|
|
|
95
101
|
if (!popover || !button) {
|
|
96
102
|
return;
|
|
97
103
|
}
|
|
104
|
+
const result = instance.container.querySelector('[data-diagnostics-result]');
|
|
105
|
+
if (forceOpen === undefined && result && !result.hidden) {
|
|
106
|
+
closeResult(instance);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
98
109
|
const open = typeof forceOpen === 'boolean' ? forceOpen : popover.hidden;
|
|
99
110
|
if (open) {
|
|
111
|
+
closeResult(instance);
|
|
100
112
|
instance.callbacks.onBeforeOpen?.();
|
|
101
113
|
}
|
|
102
114
|
popover.hidden = !open;
|
|
@@ -123,6 +135,7 @@
|
|
|
123
135
|
|
|
124
136
|
function closeResult(target) {
|
|
125
137
|
const instance = target?._instance || target;
|
|
138
|
+
if (instance) instance.resultDismissed = true;
|
|
126
139
|
const result = instance?.container?.querySelector('[data-diagnostics-result]');
|
|
127
140
|
if (result) {
|
|
128
141
|
hideFloating(result);
|
|
@@ -131,6 +144,7 @@
|
|
|
131
144
|
|
|
132
145
|
function showLoading(target, title, subtitle) {
|
|
133
146
|
const instance = target?._instance || target;
|
|
147
|
+
if (instance) instance.resultDismissed = false;
|
|
134
148
|
showResult(instance, {
|
|
135
149
|
title,
|
|
136
150
|
subtitle: subtitle || t(instance, 'diagnosticsLoading'),
|
|
@@ -141,13 +155,16 @@
|
|
|
141
155
|
|
|
142
156
|
function showResult(target, result = {}) {
|
|
143
157
|
const instance = target?._instance || target;
|
|
158
|
+
if (instance?.resultDismissed) return;
|
|
144
159
|
const root = instance?.container?.querySelector('[data-diagnostics-result]');
|
|
145
160
|
if (!root) {
|
|
146
161
|
return;
|
|
147
162
|
}
|
|
148
163
|
|
|
164
|
+
const wasHidden = root.hidden;
|
|
149
165
|
root.hidden = false;
|
|
150
166
|
root.dataset.status = result.status || 'info';
|
|
167
|
+
root.setAttribute('aria-label', result.title || t(instance, 'diagnosticsResult'));
|
|
151
168
|
root.querySelector('[data-diagnostics-result-title]').textContent = result.title || t(instance, 'diagnosticsResult');
|
|
152
169
|
root.querySelector('[data-diagnostics-result-subtitle]').textContent = result.subtitle || '';
|
|
153
170
|
|
|
@@ -188,7 +205,8 @@
|
|
|
188
205
|
details.hidden = !technicalText;
|
|
189
206
|
technical.textContent = technicalText;
|
|
190
207
|
closeMenu(instance);
|
|
191
|
-
openFloating(instance, root,
|
|
208
|
+
openFloating(instance, root, 400);
|
|
209
|
+
if (wasHidden) root.querySelector('[data-diagnostics-result-close]')?.focus({ preventScroll: true });
|
|
192
210
|
}
|
|
193
211
|
|
|
194
212
|
// Keep DOM ownership (theme, locale and callbacks), but render above clipping
|
|
@@ -237,12 +255,20 @@
|
|
|
237
255
|
if (!(width > 0 && height > 0)) return;
|
|
238
256
|
const margin = 12;
|
|
239
257
|
const gap = 8;
|
|
240
|
-
const
|
|
241
|
-
const
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
258
|
+
const viewportLeft = viewport?.offsetLeft || 0;
|
|
259
|
+
const viewportTop = viewport?.offsetTop || 0;
|
|
260
|
+
const panel = instance.container.closest?.('#codex-overleaf-panel')?.getBoundingClientRect?.();
|
|
261
|
+
const leftEdge = Math.max(viewportLeft, panel?.left ?? viewportLeft) + margin;
|
|
262
|
+
const topEdge = Math.max(viewportTop, panel?.top ?? viewportTop) + margin;
|
|
263
|
+
const rightEdge = Math.min(viewportLeft + width, panel?.right ?? viewportLeft + width) - margin;
|
|
264
|
+
const bottomEdge = Math.min(viewportTop + height, panel?.bottom ?? viewportTop + height) - margin;
|
|
265
|
+
if (rightEdge <= leftEdge || bottomEdge <= topEdge) {
|
|
266
|
+
closeMenu(instance);
|
|
267
|
+
closeResult(instance);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
element.style.width = `${Math.min(preferredWidth, rightEdge - leftEdge)}px`;
|
|
271
|
+
element.style.maxHeight = `${Math.min(480, bottomEdge - topEdge)}px`;
|
|
246
272
|
const anchor = button.getBoundingClientRect();
|
|
247
273
|
const bounds = element.getBoundingClientRect();
|
|
248
274
|
const below = Math.max(0, bottomEdge - anchor.bottom - gap);
|
|
@@ -307,9 +333,11 @@
|
|
|
307
333
|
list.className = 'codex-diagnostics-checks';
|
|
308
334
|
for (const check of checks) {
|
|
309
335
|
if (!check) continue;
|
|
310
|
-
const row = document.createElement('
|
|
336
|
+
const row = document.createElement('details');
|
|
311
337
|
row.className = 'codex-diagnostics-check';
|
|
312
338
|
row.dataset.status = healthBucket(check.status);
|
|
339
|
+
row.open = row.dataset.status === 'warn' || row.dataset.status === 'fail';
|
|
340
|
+
const heading = document.createElement('summary');
|
|
313
341
|
|
|
314
342
|
const glyph = document.createElement('span');
|
|
315
343
|
glyph.className = 'codex-diagnostics-check-glyph';
|
|
@@ -320,7 +348,7 @@
|
|
|
320
348
|
const title = document.createElement('div');
|
|
321
349
|
title.className = 'codex-diagnostics-check-title';
|
|
322
350
|
title.textContent = check.title || '';
|
|
323
|
-
|
|
351
|
+
heading.append(glyph, title);
|
|
324
352
|
if (check.summary) {
|
|
325
353
|
const summary = document.createElement('div');
|
|
326
354
|
summary.className = 'codex-diagnostics-check-summary';
|
|
@@ -334,7 +362,7 @@
|
|
|
334
362
|
textWrap.append(next);
|
|
335
363
|
}
|
|
336
364
|
|
|
337
|
-
row.append(
|
|
365
|
+
row.append(heading, textWrap);
|
|
338
366
|
list.append(row);
|
|
339
367
|
}
|
|
340
368
|
container.append(list);
|
|
@@ -358,6 +386,7 @@
|
|
|
358
386
|
return;
|
|
359
387
|
}
|
|
360
388
|
closeMenu(instance);
|
|
389
|
+
closeResult(instance);
|
|
361
390
|
}, true);
|
|
362
391
|
listen(doc, 'keydown', event => {
|
|
363
392
|
if (event.key !== 'Escape') return;
|
|
@@ -374,7 +403,7 @@
|
|
|
374
403
|
const reposition = () => {
|
|
375
404
|
frame = null;
|
|
376
405
|
positionFloating(instance, instance.container.querySelector('[data-diagnostics-popover]'), 300);
|
|
377
|
-
positionFloating(instance, instance.container.querySelector('[data-diagnostics-result]'),
|
|
406
|
+
positionFloating(instance, instance.container.querySelector('[data-diagnostics-result]'), 400);
|
|
378
407
|
};
|
|
379
408
|
const schedule = () => {
|
|
380
409
|
if (frame !== null) return;
|
|
@@ -103,13 +103,13 @@
|
|
|
103
103
|
const acceptHunkBtn = document.createElement('button');
|
|
104
104
|
acceptHunkBtn.type = 'button';
|
|
105
105
|
acceptHunkBtn.setAttribute('data-diff-hunk-accept', '');
|
|
106
|
-
acceptHunkBtn.
|
|
106
|
+
acceptHunkBtn.innerHTML = '<svg class="codex-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="m3.5 8 3 3 6-6"/></svg>';
|
|
107
107
|
acceptHunkBtn.title = tr('diffHunkAccept');
|
|
108
108
|
acceptHunkBtn.setAttribute('aria-label', tr('diffHunkAccept'));
|
|
109
109
|
const rejectHunkBtn = document.createElement('button');
|
|
110
110
|
rejectHunkBtn.type = 'button';
|
|
111
111
|
rejectHunkBtn.setAttribute('data-diff-hunk-reject', '');
|
|
112
|
-
rejectHunkBtn.
|
|
112
|
+
rejectHunkBtn.innerHTML = '<svg class="codex-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="m4 4 8 8M12 4l-8 8"/></svg>';
|
|
113
113
|
rejectHunkBtn.title = tr('diffHunkReject');
|
|
114
114
|
rejectHunkBtn.setAttribute('aria-label', tr('diffHunkReject'));
|
|
115
115
|
const jumpHunkBtn = document.createElement('button');
|
|
@@ -619,13 +619,13 @@
|
|
|
619
619
|
const acceptBtn = document.createElement('button');
|
|
620
620
|
acceptBtn.type = 'button';
|
|
621
621
|
acceptBtn.dataset.diffAccept = '';
|
|
622
|
-
acceptBtn.
|
|
622
|
+
acceptBtn.innerHTML = '<svg class="codex-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="m3.5 8 3 3 6-6"/></svg>';
|
|
623
623
|
acceptBtn.title = tr('diffAccept');
|
|
624
624
|
acceptBtn.setAttribute('aria-label', tr('diffAccept'));
|
|
625
625
|
const rejectBtn = document.createElement('button');
|
|
626
626
|
rejectBtn.type = 'button';
|
|
627
627
|
rejectBtn.dataset.diffReject = '';
|
|
628
|
-
rejectBtn.
|
|
628
|
+
rejectBtn.innerHTML = '<svg class="codex-glyph" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path d="m4 4 8 8M12 4l-8 8"/></svg>';
|
|
629
629
|
rejectBtn.title = tr('diffReject');
|
|
630
630
|
rejectBtn.setAttribute('aria-label', tr('diffReject'));
|
|
631
631
|
|
|
@@ -775,7 +775,10 @@
|
|
|
775
775
|
title,
|
|
776
776
|
status: 'completed'
|
|
777
777
|
});
|
|
778
|
-
|
|
778
|
+
// Written changes are a receipt, not a review: one folded row per file.
|
|
779
|
+
const container = typeof deps.renderWrittenChanges === 'function'
|
|
780
|
+
? deps.renderWrittenChanges(visibleChanges)
|
|
781
|
+
: createDiffReviewElement(visibleChanges, { readonly: true }).container;
|
|
779
782
|
events = getRunEvents() || events;
|
|
780
783
|
events.append(container);
|
|
781
784
|
scrollLogToBottom();
|