ontrackd 0.0.1 → 0.11.1
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/LICENSE +14 -0
- package/README.md +133 -2
- package/dist/cli/build.d.ts +1 -0
- package/dist/cli/build.js +172 -0
- package/dist/cli/build.js.map +1 -0
- package/dist/cli/cloud.d.ts +20 -0
- package/dist/cli/cloud.js +395 -0
- package/dist/cli/cloud.js.map +1 -0
- package/dist/cli/feedback.d.ts +4 -0
- package/dist/cli/feedback.js +90 -0
- package/dist/cli/feedback.js.map +1 -0
- package/dist/cli/hugo.d.ts +1 -0
- package/dist/cli/hugo.js +396 -0
- package/dist/cli/hugo.js.map +1 -0
- package/dist/cli/init.d.ts +8 -0
- package/dist/cli/init.js +346 -0
- package/dist/cli/init.js.map +1 -0
- package/dist/cli/invite.d.ts +2 -0
- package/dist/cli/invite.js +65 -0
- package/dist/cli/invite.js.map +1 -0
- package/dist/cli/link.d.ts +20 -0
- package/dist/cli/link.js +287 -0
- package/dist/cli/link.js.map +1 -0
- package/dist/cli/pull.d.ts +31 -0
- package/dist/cli/pull.js +273 -0
- package/dist/cli/pull.js.map +1 -0
- package/dist/cli/push.d.ts +9 -0
- package/dist/cli/push.js +57 -0
- package/dist/cli/push.js.map +1 -0
- package/dist/cli/remote.d.ts +1 -0
- package/dist/cli/remote.js +114 -0
- package/dist/cli/remote.js.map +1 -0
- package/dist/cli/serve.d.ts +1 -0
- package/dist/cli/serve.js +178 -0
- package/dist/cli/serve.js.map +1 -0
- package/dist/cli/sidecar.d.ts +9 -0
- package/dist/cli/sidecar.js +23 -0
- package/dist/cli/sidecar.js.map +1 -0
- package/dist/core/anchorId.d.ts +42 -0
- package/dist/core/anchorId.js +50 -0
- package/dist/core/anchorId.js.map +1 -0
- package/dist/core/apiKind.d.ts +42 -0
- package/dist/core/apiKind.js +83 -0
- package/dist/core/apiKind.js.map +1 -0
- package/dist/core/astroAnchors.d.ts +39 -0
- package/dist/core/astroAnchors.js +217 -0
- package/dist/core/astroAnchors.js.map +1 -0
- package/dist/core/attachmentTypes.d.ts +74 -0
- package/dist/core/attachmentTypes.js +199 -0
- package/dist/core/attachmentTypes.js.map +1 -0
- package/dist/core/elementHints.d.ts +40 -0
- package/dist/core/elementHints.js +116 -0
- package/dist/core/elementHints.js.map +1 -0
- package/dist/core/exportTaskDoc.d.ts +81 -0
- package/dist/core/exportTaskDoc.js +828 -0
- package/dist/core/exportTaskDoc.js.map +1 -0
- package/dist/core/feedbackTypes.d.ts +241 -0
- package/dist/core/feedbackTypes.js +2 -0
- package/dist/core/feedbackTypes.js.map +1 -0
- package/dist/core/fingerprint.d.ts +12 -0
- package/dist/core/fingerprint.js +24 -0
- package/dist/core/fingerprint.js.map +1 -0
- package/dist/core/htmlAnchors.d.ts +18 -0
- package/dist/core/htmlAnchors.js +157 -0
- package/dist/core/htmlAnchors.js.map +1 -0
- package/dist/core/imageSniff.d.ts +7 -0
- package/dist/core/imageSniff.js +12 -0
- package/dist/core/imageSniff.js.map +1 -0
- package/dist/core/ordering.d.ts +16 -0
- package/dist/core/ordering.js +10 -0
- package/dist/core/ordering.js.map +1 -0
- package/dist/core/oxcAst.d.ts +39 -0
- package/dist/core/oxcAst.js +147 -0
- package/dist/core/oxcAst.js.map +1 -0
- package/dist/core/pageUrl.d.ts +10 -0
- package/dist/core/pageUrl.js +27 -0
- package/dist/core/pageUrl.js.map +1 -0
- package/dist/core/participants.d.ts +14 -0
- package/dist/core/participants.js +38 -0
- package/dist/core/participants.js.map +1 -0
- package/dist/core/ports.d.ts +86 -0
- package/dist/core/ports.js +2 -0
- package/dist/core/ports.js.map +1 -0
- package/dist/core/projectSecret.d.ts +9 -0
- package/dist/core/projectSecret.js +57 -0
- package/dist/core/projectSecret.js.map +1 -0
- package/dist/core/recipe.d.ts +117 -0
- package/dist/core/recipe.js +181 -0
- package/dist/core/recipe.js.map +1 -0
- package/dist/core/recordingSummary.d.ts +12 -0
- package/dist/core/recordingSummary.js +150 -0
- package/dist/core/recordingSummary.js.map +1 -0
- package/dist/core/resolveAnchors.d.ts +70 -0
- package/dist/core/resolveAnchors.js +101 -0
- package/dist/core/resolveAnchors.js.map +1 -0
- package/dist/core/scriptImport.d.ts +10 -0
- package/dist/core/scriptImport.js +18 -0
- package/dist/core/scriptImport.js.map +1 -0
- package/dist/core/sourceAnchors.d.ts +62 -0
- package/dist/core/sourceAnchors.js +82 -0
- package/dist/core/sourceAnchors.js.map +1 -0
- package/dist/core/sourceContext.d.ts +62 -0
- package/dist/core/sourceContext.js +182 -0
- package/dist/core/sourceContext.js.map +1 -0
- package/dist/core/sourcePath.d.ts +2 -0
- package/dist/core/sourcePath.js +11 -0
- package/dist/core/sourcePath.js.map +1 -0
- package/dist/core/staleness.d.ts +118 -0
- package/dist/core/staleness.js +155 -0
- package/dist/core/staleness.js.map +1 -0
- package/dist/core/styleOrigin.d.ts +98 -0
- package/dist/core/styleOrigin.js +142 -0
- package/dist/core/styleOrigin.js.map +1 -0
- package/dist/core/svelteAnchors.d.ts +18 -0
- package/dist/core/svelteAnchors.js +125 -0
- package/dist/core/svelteAnchors.js.map +1 -0
- package/dist/core/taskFiles.d.ts +31 -0
- package/dist/core/taskFiles.js +55 -0
- package/dist/core/taskFiles.js.map +1 -0
- package/dist/core/untrusted.d.ts +57 -0
- package/dist/core/untrusted.js +268 -0
- package/dist/core/untrusted.js.map +1 -0
- package/dist/core/vueAnchors.d.ts +21 -0
- package/dist/core/vueAnchors.js +130 -0
- package/dist/core/vueAnchors.js.map +1 -0
- package/dist/expo/app/Avatar.d.ts +6 -0
- package/dist/expo/app/Avatar.js +12 -0
- package/dist/expo/app/Avatar.js.map +1 -0
- package/dist/expo/app/Bars.d.ts +9 -0
- package/dist/expo/app/Bars.js +38 -0
- package/dist/expo/app/Bars.js.map +1 -0
- package/dist/expo/app/CommentThreadSheet.d.ts +35 -0
- package/dist/expo/app/CommentThreadSheet.js +200 -0
- package/dist/expo/app/CommentThreadSheet.js.map +1 -0
- package/dist/expo/app/CommentsSheet.d.ts +22 -0
- package/dist/expo/app/CommentsSheet.js +76 -0
- package/dist/expo/app/CommentsSheet.js.map +1 -0
- package/dist/expo/app/Files.d.ts +16 -0
- package/dist/expo/app/Files.js +62 -0
- package/dist/expo/app/Files.js.map +1 -0
- package/dist/expo/app/Highlight.d.ts +5 -0
- package/dist/expo/app/Highlight.js +12 -0
- package/dist/expo/app/Highlight.js.map +1 -0
- package/dist/expo/app/Icon.d.ts +9 -0
- package/dist/expo/app/Icon.js +22 -0
- package/dist/expo/app/Icon.js.map +1 -0
- package/dist/expo/app/MarkerPins.d.ts +10 -0
- package/dist/expo/app/MarkerPins.js +70 -0
- package/dist/expo/app/MarkerPins.js.map +1 -0
- package/dist/expo/app/Provider.d.ts +13 -0
- package/dist/expo/app/Provider.js +597 -0
- package/dist/expo/app/Provider.js.map +1 -0
- package/dist/expo/app/Sheet.d.ts +53 -0
- package/dist/expo/app/Sheet.js +106 -0
- package/dist/expo/app/Sheet.js.map +1 -0
- package/dist/expo/app/Toolbar.d.ts +26 -0
- package/dist/expo/app/Toolbar.js +71 -0
- package/dist/expo/app/Toolbar.js.map +1 -0
- package/dist/expo/app/adapter.d.ts +55 -0
- package/dist/expo/app/adapter.js +145 -0
- package/dist/expo/app/adapter.js.map +1 -0
- package/dist/expo/app/api.d.ts +68 -0
- package/dist/expo/app/api.js +86 -0
- package/dist/expo/app/api.js.map +1 -0
- package/dist/expo/app/assets/attach.png +0 -0
- package/dist/expo/app/assets/close.png +0 -0
- package/dist/expo/app/assets/comment.png +0 -0
- package/dist/expo/app/assets/edit.png +0 -0
- package/dist/expo/app/assets/file.png +0 -0
- package/dist/expo/app/assets/narrow.png +0 -0
- package/dist/expo/app/assets/panel.png +0 -0
- package/dist/expo/app/assets/pins.png +0 -0
- package/dist/expo/app/assets/pinsOff.png +0 -0
- package/dist/expo/app/assets/remove.png +0 -0
- package/dist/expo/app/assets/reopen.png +0 -0
- package/dist/expo/app/assets/resolve.png +0 -0
- package/dist/expo/app/assets/send.png +0 -0
- package/dist/expo/app/assets/widen.png +0 -0
- package/dist/expo/app/attachments.d.ts +93 -0
- package/dist/expo/app/attachments.js +181 -0
- package/dist/expo/app/attachments.js.map +1 -0
- package/dist/expo/app/cloudApi.d.ts +63 -0
- package/dist/expo/app/cloudApi.js +330 -0
- package/dist/expo/app/cloudApi.js.map +1 -0
- package/dist/expo/app/cloudAuth.d.ts +20 -0
- package/dist/expo/app/cloudAuth.js +71 -0
- package/dist/expo/app/cloudAuth.js.map +1 -0
- package/dist/expo/app/cloudHttp.d.ts +20 -0
- package/dist/expo/app/cloudHttp.js +46 -0
- package/dist/expo/app/cloudHttp.js.map +1 -0
- package/dist/expo/app/cloudSession.d.ts +30 -0
- package/dist/expo/app/cloudSession.js +72 -0
- package/dist/expo/app/cloudSession.js.map +1 -0
- package/dist/expo/app/comments.d.ts +20 -0
- package/dist/expo/app/comments.js +131 -0
- package/dist/expo/app/comments.js.map +1 -0
- package/dist/expo/app/devMenuNone.d.ts +5 -0
- package/dist/expo/app/devMenuNone.js +3 -0
- package/dist/expo/app/devMenuNone.js.map +1 -0
- package/dist/expo/app/devServerNone.d.ts +4 -0
- package/dist/expo/app/devServerNone.js +4 -0
- package/dist/expo/app/devServerNone.js.map +1 -0
- package/dist/expo/app/embeddedConfig.d.ts +1 -0
- package/dist/expo/app/embeddedConfig.js +12 -0
- package/dist/expo/app/embeddedConfig.js.map +1 -0
- package/dist/expo/app/embeddedConfigCloud.d.ts +2 -0
- package/dist/expo/app/embeddedConfigCloud.js +8 -0
- package/dist/expo/app/embeddedConfigCloud.js.map +1 -0
- package/dist/expo/app/embeddedConfigNone.d.ts +2 -0
- package/dist/expo/app/embeddedConfigNone.js +3 -0
- package/dist/expo/app/embeddedConfigNone.js.map +1 -0
- package/dist/expo/app/expo.d.ts +4 -0
- package/dist/expo/app/expo.js +35 -0
- package/dist/expo/app/expo.js.map +1 -0
- package/dist/expo/app/expoGo.d.ts +4 -0
- package/dist/expo/app/expoGo.js +33 -0
- package/dist/expo/app/expoGo.js.map +1 -0
- package/dist/expo/app/expoPickers.d.ts +11 -0
- package/dist/expo/app/expoPickers.js +91 -0
- package/dist/expo/app/expoPickers.js.map +1 -0
- package/dist/expo/app/expoRandom.d.ts +6 -0
- package/dist/expo/app/expoRandom.js +21 -0
- package/dist/expo/app/expoRandom.js.map +1 -0
- package/dist/expo/app/idle.d.ts +4 -0
- package/dist/expo/app/idle.js +7 -0
- package/dist/expo/app/idle.js.map +1 -0
- package/dist/expo/app/index.d.ts +3 -0
- package/dist/expo/app/index.js +3 -0
- package/dist/expo/app/index.js.map +1 -0
- package/dist/expo/app/interactions.d.ts +38 -0
- package/dist/expo/app/interactions.js +40 -0
- package/dist/expo/app/interactions.js.map +1 -0
- package/dist/expo/app/markers.d.ts +28 -0
- package/dist/expo/app/markers.js +187 -0
- package/dist/expo/app/markers.js.map +1 -0
- package/dist/expo/app/movedAnchors.d.ts +46 -0
- package/dist/expo/app/movedAnchors.js +39 -0
- package/dist/expo/app/movedAnchors.js.map +1 -0
- package/dist/expo/app/native.d.ts +12 -0
- package/dist/expo/app/native.js +78 -0
- package/dist/expo/app/native.js.map +1 -0
- package/dist/expo/app/panel.d.ts +27 -0
- package/dist/expo/app/panel.js +37 -0
- package/dist/expo/app/panel.js.map +1 -0
- package/dist/expo/app/payload.d.ts +43 -0
- package/dist/expo/app/payload.js +22 -0
- package/dist/expo/app/payload.js.map +1 -0
- package/dist/expo/app/pick.d.ts +14 -0
- package/dist/expo/app/pick.js +124 -0
- package/dist/expo/app/pick.js.map +1 -0
- package/dist/expo/app/pickerNone.d.ts +1 -0
- package/dist/expo/app/pickerNone.js +2 -0
- package/dist/expo/app/pickerNone.js.map +1 -0
- package/dist/expo/app/placement.d.ts +53 -0
- package/dist/expo/app/placement.js +100 -0
- package/dist/expo/app/placement.js.map +1 -0
- package/dist/expo/app/random.d.ts +13 -0
- package/dist/expo/app/random.js +56 -0
- package/dist/expo/app/random.js.map +1 -0
- package/dist/expo/app/reactNative.d.ts +2 -0
- package/dist/expo/app/reactNative.js +3 -0
- package/dist/expo/app/reactNative.js.map +1 -0
- package/dist/expo/app/runtimeConfig.d.ts +30 -0
- package/dist/expo/app/runtimeConfig.js +104 -0
- package/dist/expo/app/runtimeConfig.js.map +1 -0
- package/dist/expo/app/sheetMotion.d.ts +22 -0
- package/dist/expo/app/sheetMotion.js +39 -0
- package/dist/expo/app/sheetMotion.js.map +1 -0
- package/dist/expo/app/signIn.d.ts +32 -0
- package/dist/expo/app/signIn.js +28 -0
- package/dist/expo/app/signIn.js.map +1 -0
- package/dist/expo/app/state.d.ts +45 -0
- package/dist/expo/app/state.js +32 -0
- package/dist/expo/app/state.js.map +1 -0
- package/dist/expo/app/theme.d.ts +15 -0
- package/dist/expo/app/theme.js +9 -0
- package/dist/expo/app/theme.js.map +1 -0
- package/dist/expo/app/types.d.ts +87 -0
- package/dist/expo/app/types.js +2 -0
- package/dist/expo/app/types.js.map +1 -0
- package/dist/expo/app/useCloudReviewer.d.ts +75 -0
- package/dist/expo/app/useCloudReviewer.js +211 -0
- package/dist/expo/app/useCloudReviewer.js.map +1 -0
- package/dist/expo/app/useComments.d.ts +64 -0
- package/dist/expo/app/useComments.js +156 -0
- package/dist/expo/app/useComments.js.map +1 -0
- package/dist/expo/app/useUploads.d.ts +32 -0
- package/dist/expo/app/useUploads.js +106 -0
- package/dist/expo/app/useUploads.js.map +1 -0
- package/dist/expo/expoGoMetro.cjs +83 -0
- package/dist/expo/expoMetro.cjs +86 -0
- package/dist/expo/metro.cjs +304 -0
- package/dist/expo/metroBuild.d.ts +22 -0
- package/dist/expo/metroBuild.js +169 -0
- package/dist/expo/metroBuild.js.map +1 -0
- package/dist/expo/middleware.d.ts +11 -0
- package/dist/expo/middleware.js +26 -0
- package/dist/expo/middleware.js.map +1 -0
- package/dist/expo/mode.d.ts +20 -0
- package/dist/expo/mode.js +37 -0
- package/dist/expo/mode.js.map +1 -0
- package/dist/expo/publicConfig.d.ts +37 -0
- package/dist/expo/publicConfig.js +87 -0
- package/dist/expo/publicConfig.js.map +1 -0
- package/dist/expo/transform.d.ts +22 -0
- package/dist/expo/transform.js +38 -0
- package/dist/expo/transform.js.map +1 -0
- package/dist/expo/transformer.cjs +73 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +17 -0
- package/dist/index.js.map +1 -0
- package/dist/integration/apiRoutes.d.ts +2 -0
- package/dist/integration/apiRoutes.js +3 -0
- package/dist/integration/apiRoutes.js.map +1 -0
- package/dist/integration/buildCredentials.d.ts +12 -0
- package/dist/integration/buildCredentials.js +97 -0
- package/dist/integration/buildCredentials.js.map +1 -0
- package/dist/integration/buildSession.d.ts +8 -0
- package/dist/integration/buildSession.js +96 -0
- package/dist/integration/buildSession.js.map +1 -0
- package/dist/integration/bundleCheck.d.ts +43 -0
- package/dist/integration/bundleCheck.js +111 -0
- package/dist/integration/bundleCheck.js.map +1 -0
- package/dist/integration/commentPull.d.ts +134 -0
- package/dist/integration/commentPull.js +260 -0
- package/dist/integration/commentPull.js.map +1 -0
- package/dist/integration/configuredApi.d.ts +7 -0
- package/dist/integration/configuredApi.js +24 -0
- package/dist/integration/configuredApi.js.map +1 -0
- package/dist/integration/devCloud.d.ts +27 -0
- package/dist/integration/devCloud.js +56 -0
- package/dist/integration/devCloud.js.map +1 -0
- package/dist/integration/devReviewLinks.d.ts +2 -0
- package/dist/integration/devReviewLinks.js +10 -0
- package/dist/integration/devReviewLinks.js.map +1 -0
- package/dist/integration/gitBranch.d.ts +19 -0
- package/dist/integration/gitBranch.js +56 -0
- package/dist/integration/gitBranch.js.map +1 -0
- package/dist/integration/importPlan.d.ts +19 -0
- package/dist/integration/importPlan.js +90 -0
- package/dist/integration/importPlan.js.map +1 -0
- package/dist/integration/index.d.ts +14 -0
- package/dist/integration/index.js +13 -0
- package/dist/integration/index.js.map +1 -0
- package/dist/integration/manifest.d.ts +120 -0
- package/dist/integration/manifest.js +147 -0
- package/dist/integration/manifest.js.map +1 -0
- package/dist/integration/manifestParts.d.ts +29 -0
- package/dist/integration/manifestParts.js +65 -0
- package/dist/integration/manifestParts.js.map +1 -0
- package/dist/integration/manifestSink.d.ts +75 -0
- package/dist/integration/manifestSink.js +157 -0
- package/dist/integration/manifestSink.js.map +1 -0
- package/dist/integration/manifestUpload.d.ts +64 -0
- package/dist/integration/manifestUpload.js +177 -0
- package/dist/integration/manifestUpload.js.map +1 -0
- package/dist/integration/middleware.d.ts +55 -0
- package/dist/integration/middleware.js +379 -0
- package/dist/integration/middleware.js.map +1 -0
- package/dist/integration/nextStyles.d.ts +4 -0
- package/dist/integration/nextStyles.js +121 -0
- package/dist/integration/nextStyles.js.map +1 -0
- package/dist/integration/requestGuards.d.ts +71 -0
- package/dist/integration/requestGuards.js +255 -0
- package/dist/integration/requestGuards.js.map +1 -0
- package/dist/integration/sharedBuild.d.ts +71 -0
- package/dist/integration/sharedBuild.js +105 -0
- package/dist/integration/sharedBuild.js.map +1 -0
- package/dist/integration/sharedInject.d.ts +88 -0
- package/dist/integration/sharedInject.js +164 -0
- package/dist/integration/sharedInject.js.map +1 -0
- package/dist/integration/sidecarProcess.d.ts +26 -0
- package/dist/integration/sidecarProcess.js +137 -0
- package/dist/integration/sidecarProcess.js.map +1 -0
- package/dist/integration/styleCollector.d.ts +49 -0
- package/dist/integration/styleCollector.js +220 -0
- package/dist/integration/styleCollector.js.map +1 -0
- package/dist/integration/transform.d.ts +24 -0
- package/dist/integration/transform.js +36 -0
- package/dist/integration/transform.js.map +1 -0
- package/dist/integration/tunnelClient.d.ts +44 -0
- package/dist/integration/tunnelClient.js +148 -0
- package/dist/integration/tunnelClient.js.map +1 -0
- package/dist/integration/tunnelProtocol.d.ts +152 -0
- package/dist/integration/tunnelProtocol.js +110 -0
- package/dist/integration/tunnelProtocol.js.map +1 -0
- package/dist/mcp/cli.d.ts +2 -0
- package/dist/mcp/cli.js +327 -0
- package/dist/mcp/cli.js.map +1 -0
- package/dist/mcp/cloudRefresh.d.ts +36 -0
- package/dist/mcp/cloudRefresh.js +52 -0
- package/dist/mcp/cloudRefresh.js.map +1 -0
- package/dist/mcp/context.d.ts +7 -0
- package/dist/mcp/context.js +18 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/files.d.ts +66 -0
- package/dist/mcp/files.js +157 -0
- package/dist/mcp/files.js.map +1 -0
- package/dist/mcp/search.d.ts +3 -0
- package/dist/mcp/search.js +9 -0
- package/dist/mcp/search.js.map +1 -0
- package/dist/mcp/server.d.ts +50 -0
- package/dist/mcp/server.js +555 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/overlay/anchors.d.ts +130 -0
- package/dist/overlay/anchors.js +365 -0
- package/dist/overlay/anchors.js.map +1 -0
- package/dist/overlay/api.d.ts +150 -0
- package/dist/overlay/api.js +259 -0
- package/dist/overlay/api.js.map +1 -0
- package/dist/overlay/attachments.d.ts +60 -0
- package/dist/overlay/attachments.js +163 -0
- package/dist/overlay/attachments.js.map +1 -0
- package/dist/overlay/browser.d.ts +1 -0
- package/dist/overlay/browser.js +203 -0
- package/dist/overlay/browser.js.map +1 -0
- package/dist/overlay/chip.d.ts +27 -0
- package/dist/overlay/chip.js +31 -0
- package/dist/overlay/chip.js.map +1 -0
- package/dist/overlay/compact.d.ts +11 -0
- package/dist/overlay/compact.js +21 -0
- package/dist/overlay/compact.js.map +1 -0
- package/dist/overlay/cssScope.d.ts +46 -0
- package/dist/overlay/cssScope.js +180 -0
- package/dist/overlay/cssScope.js.map +1 -0
- package/dist/overlay/cursor.d.ts +2 -0
- package/dist/overlay/cursor.js +68 -0
- package/dist/overlay/cursor.js.map +1 -0
- package/dist/overlay/devBrowser.d.ts +1 -0
- package/dist/overlay/devBrowser.js +18 -0
- package/dist/overlay/devBrowser.js.map +1 -0
- package/dist/overlay/devReview.d.ts +4 -0
- package/dist/overlay/devReview.js +18 -0
- package/dist/overlay/devReview.js.map +1 -0
- package/dist/overlay/directReviewer.d.ts +149 -0
- package/dist/overlay/directReviewer.js +448 -0
- package/dist/overlay/directReviewer.js.map +1 -0
- package/dist/overlay/elementDescription.d.ts +10 -0
- package/dist/overlay/elementDescription.js +251 -0
- package/dist/overlay/elementDescription.js.map +1 -0
- package/dist/overlay/icons.d.ts +8 -0
- package/dist/overlay/icons.js +36 -0
- package/dist/overlay/icons.js.map +1 -0
- package/dist/overlay/identity.d.ts +48 -0
- package/dist/overlay/identity.js +125 -0
- package/dist/overlay/identity.js.map +1 -0
- package/dist/overlay/localMachine.d.ts +23 -0
- package/dist/overlay/localMachine.js +40 -0
- package/dist/overlay/localMachine.js.map +1 -0
- package/dist/overlay/magicLink.d.ts +10 -0
- package/dist/overlay/magicLink.js +87 -0
- package/dist/overlay/magicLink.js.map +1 -0
- package/dist/overlay/modern-screenshot.js +1676 -0
- package/dist/overlay/movedAnchors.d.ts +30 -0
- package/dist/overlay/movedAnchors.js +128 -0
- package/dist/overlay/movedAnchors.js.map +1 -0
- package/dist/overlay/notificationGroups.d.ts +2 -0
- package/dist/overlay/notificationGroups.js +41 -0
- package/dist/overlay/notificationGroups.js.map +1 -0
- package/dist/overlay/permissions.d.ts +10 -0
- package/dist/overlay/permissions.js +9 -0
- package/dist/overlay/permissions.js.map +1 -0
- package/dist/overlay/pinGroups.d.ts +16 -0
- package/dist/overlay/pinGroups.js +17 -0
- package/dist/overlay/pinGroups.js.map +1 -0
- package/dist/overlay/presence.d.ts +50 -0
- package/dist/overlay/presence.js +258 -0
- package/dist/overlay/presence.js.map +1 -0
- package/dist/overlay/projectChannel.d.ts +11 -0
- package/dist/overlay/projectChannel.js +111 -0
- package/dist/overlay/projectChannel.js.map +1 -0
- package/dist/overlay/recorder.d.ts +56 -0
- package/dist/overlay/recorder.js +130 -0
- package/dist/overlay/recorder.js.map +1 -0
- package/dist/overlay/reviewMode.d.ts +21 -0
- package/dist/overlay/reviewMode.js +59 -0
- package/dist/overlay/reviewMode.js.map +1 -0
- package/dist/overlay/reviewerAuth.d.ts +131 -0
- package/dist/overlay/reviewerAuth.js +279 -0
- package/dist/overlay/reviewerAuth.js.map +1 -0
- package/dist/overlay/route.d.ts +18 -0
- package/dist/overlay/route.js +56 -0
- package/dist/overlay/route.js.map +1 -0
- package/dist/overlay/rrweb-record.js +63 -0
- package/dist/overlay/runtime.d.ts +1 -0
- package/dist/overlay/runtime.js +4857 -0
- package/dist/overlay/runtime.js.map +1 -0
- package/dist/overlay/session.d.ts +32 -0
- package/dist/overlay/session.js +76 -0
- package/dist/overlay/session.js.map +1 -0
- package/dist/overlay/sharedMode.d.ts +38 -0
- package/dist/overlay/sharedMode.js +37 -0
- package/dist/overlay/sharedMode.js.map +1 -0
- package/dist/overlay/sheet.d.ts +73 -0
- package/dist/overlay/sheet.js +278 -0
- package/dist/overlay/sheet.js.map +1 -0
- package/dist/overlay/snapshot.d.ts +26 -0
- package/dist/overlay/snapshot.js +185 -0
- package/dist/overlay/snapshot.js.map +1 -0
- package/dist/overlay/state.d.ts +63 -0
- package/dist/overlay/state.js +241 -0
- package/dist/overlay/state.js.map +1 -0
- package/dist/overlay/steps.d.ts +22 -0
- package/dist/overlay/steps.js +34 -0
- package/dist/overlay/steps.js.map +1 -0
- package/dist/overlay/styles.d.ts +7 -0
- package/dist/overlay/styles.js +1449 -0
- package/dist/overlay/styles.js.map +1 -0
- package/dist/overlay/trace.d.ts +19 -0
- package/dist/overlay/trace.js +29 -0
- package/dist/overlay/trace.js.map +1 -0
- package/dist/overlay/upload.d.ts +35 -0
- package/dist/overlay/upload.js +99 -0
- package/dist/overlay/upload.js.map +1 -0
- package/dist/plugin/astro.d.ts +31 -0
- package/dist/plugin/astro.js +22 -0
- package/dist/plugin/astro.js.map +1 -0
- package/dist/plugin/eleventy.d.ts +44 -0
- package/dist/plugin/eleventy.js +186 -0
- package/dist/plugin/eleventy.js.map +1 -0
- package/dist/plugin/next-loader.cjs +11 -0
- package/dist/plugin/next.d.ts +29 -0
- package/dist/plugin/next.js +176 -0
- package/dist/plugin/next.js.map +1 -0
- package/dist/plugin/nextOverlay.d.ts +2 -0
- package/dist/plugin/nextOverlay.js +22 -0
- package/dist/plugin/nextOverlay.js.map +1 -0
- package/dist/plugin/nextTransform.d.ts +19 -0
- package/dist/plugin/nextTransform.js +29 -0
- package/dist/plugin/nextTransform.js.map +1 -0
- package/dist/plugin/rsbuild.d.ts +25 -0
- package/dist/plugin/rsbuild.js +56 -0
- package/dist/plugin/rsbuild.js.map +1 -0
- package/dist/plugin/vite.d.ts +40 -0
- package/dist/plugin/vite.js +585 -0
- package/dist/plugin/vite.js.map +1 -0
- package/dist/plugin/webpack.d.ts +69 -0
- package/dist/plugin/webpack.js +192 -0
- package/dist/plugin/webpack.js.map +1 -0
- package/dist/remote/account.d.ts +41 -0
- package/dist/remote/account.js +177 -0
- package/dist/remote/account.js.map +1 -0
- package/dist/remote/base64url.d.ts +14 -0
- package/dist/remote/base64url.js +71 -0
- package/dist/remote/base64url.js.map +1 -0
- package/dist/remote/branchLabel.d.ts +12 -0
- package/dist/remote/branchLabel.js +20 -0
- package/dist/remote/branchLabel.js.map +1 -0
- package/dist/remote/client.d.ts +340 -0
- package/dist/remote/client.js +424 -0
- package/dist/remote/client.js.map +1 -0
- package/dist/remote/cloudApi.d.ts +72 -0
- package/dist/remote/cloudApi.js +72 -0
- package/dist/remote/cloudApi.js.map +1 -0
- package/dist/remote/codec.d.ts +54 -0
- package/dist/remote/codec.js +62 -0
- package/dist/remote/codec.js.map +1 -0
- package/dist/remote/config.d.ts +30 -0
- package/dist/remote/config.js +112 -0
- package/dist/remote/config.js.map +1 -0
- package/dist/remote/content-schema.d.ts +428 -0
- package/dist/remote/content-schema.js +209 -0
- package/dist/remote/content-schema.js.map +1 -0
- package/dist/remote/content.d.ts +44 -0
- package/dist/remote/content.js +75 -0
- package/dist/remote/content.js.map +1 -0
- package/dist/remote/envelope.d.ts +76 -0
- package/dist/remote/envelope.js +109 -0
- package/dist/remote/envelope.js.map +1 -0
- package/dist/remote/errors.d.ts +55 -0
- package/dist/remote/errors.js +63 -0
- package/dist/remote/errors.js.map +1 -0
- package/dist/remote/ids.d.ts +8 -0
- package/dist/remote/ids.js +25 -0
- package/dist/remote/ids.js.map +1 -0
- package/dist/remote/index.d.ts +7 -0
- package/dist/remote/index.js +8 -0
- package/dist/remote/index.js.map +1 -0
- package/dist/remote/keys.d.ts +62 -0
- package/dist/remote/keys.js +162 -0
- package/dist/remote/keys.js.map +1 -0
- package/dist/remote/localAnchors.d.ts +4 -0
- package/dist/remote/localAnchors.js +23 -0
- package/dist/remote/localAnchors.js.map +1 -0
- package/dist/remote/mapping.d.ts +11 -0
- package/dist/remote/mapping.js +22 -0
- package/dist/remote/mapping.js.map +1 -0
- package/dist/remote/presence.d.ts +63 -0
- package/dist/remote/presence.js +143 -0
- package/dist/remote/presence.js.map +1 -0
- package/dist/remote/realtime.d.ts +142 -0
- package/dist/remote/realtime.js +326 -0
- package/dist/remote/realtime.js.map +1 -0
- package/dist/remote/store.d.ts +183 -0
- package/dist/remote/store.js +907 -0
- package/dist/remote/store.js.map +1 -0
- package/dist/remote/sync.d.ts +113 -0
- package/dist/remote/sync.js +370 -0
- package/dist/remote/sync.js.map +1 -0
- package/dist/remote/types.d.ts +99 -0
- package/dist/remote/types.js +6 -0
- package/dist/remote/types.js.map +1 -0
- package/dist/setup/agents.d.ts +23 -0
- package/dist/setup/agents.js +80 -0
- package/dist/setup/agents.js.map +1 -0
- package/dist/setup/configure.d.ts +27 -0
- package/dist/setup/configure.js +201 -0
- package/dist/setup/configure.js.map +1 -0
- package/dist/setup/connect.d.ts +60 -0
- package/dist/setup/connect.js +244 -0
- package/dist/setup/connect.js.map +1 -0
- package/dist/setup/detect.d.ts +67 -0
- package/dist/setup/detect.js +168 -0
- package/dist/setup/detect.js.map +1 -0
- package/dist/setup/frameworks.d.ts +41 -0
- package/dist/setup/frameworks.js +81 -0
- package/dist/setup/frameworks.js.map +1 -0
- package/dist/sidecar/cli.d.ts +1 -0
- package/dist/sidecar/cli.js +70 -0
- package/dist/sidecar/cli.js.map +1 -0
- package/dist/sidecar/cloudSync.d.ts +33 -0
- package/dist/sidecar/cloudSync.js +139 -0
- package/dist/sidecar/cloudSync.js.map +1 -0
- package/dist/sidecar/commentFiles.d.ts +59 -0
- package/dist/sidecar/commentFiles.js +217 -0
- package/dist/sidecar/commentFiles.js.map +1 -0
- package/dist/sidecar/cssAttribution.d.ts +26 -0
- package/dist/sidecar/cssAttribution.js +114 -0
- package/dist/sidecar/cssAttribution.js.map +1 -0
- package/dist/sidecar/exportTasks.d.ts +38 -0
- package/dist/sidecar/exportTasks.js +249 -0
- package/dist/sidecar/exportTasks.js.map +1 -0
- package/dist/sidecar/http.d.ts +20 -0
- package/dist/sidecar/http.js +904 -0
- package/dist/sidecar/http.js.map +1 -0
- package/dist/sidecar/inviteTarget.d.ts +4 -0
- package/dist/sidecar/inviteTarget.js +32 -0
- package/dist/sidecar/inviteTarget.js.map +1 -0
- package/dist/sidecar/presence.d.ts +4 -0
- package/dist/sidecar/presence.js +92 -0
- package/dist/sidecar/presence.js.map +1 -0
- package/dist/storage/cliSession.d.ts +8 -0
- package/dist/storage/cliSession.js +41 -0
- package/dist/storage/cliSession.js.map +1 -0
- package/dist/storage/devStyleMap.d.ts +12 -0
- package/dist/storage/devStyleMap.js +31 -0
- package/dist/storage/devStyleMap.js.map +1 -0
- package/dist/storage/fileCache.d.ts +34 -0
- package/dist/storage/fileCache.js +122 -0
- package/dist/storage/fileCache.js.map +1 -0
- package/dist/storage/localAttachments.d.ts +82 -0
- package/dist/storage/localAttachments.js +276 -0
- package/dist/storage/localAttachments.js.map +1 -0
- package/dist/storage/localComments.d.ts +31 -0
- package/dist/storage/localComments.js +159 -0
- package/dist/storage/localComments.js.map +1 -0
- package/dist/storage/localCredentials.d.ts +74 -0
- package/dist/storage/localCredentials.js +210 -0
- package/dist/storage/localCredentials.js.map +1 -0
- package/dist/storage/localParticipants.d.ts +33 -0
- package/dist/storage/localParticipants.js +110 -0
- package/dist/storage/localParticipants.js.map +1 -0
- package/dist/storage/localRecipe.d.ts +22 -0
- package/dist/storage/localRecipe.js +46 -0
- package/dist/storage/localRecipe.js.map +1 -0
- package/dist/storage/localScreenshots.d.ts +23 -0
- package/dist/storage/localScreenshots.js +55 -0
- package/dist/storage/localScreenshots.js.map +1 -0
- package/dist/storage/localSource.d.ts +31 -0
- package/dist/storage/localSource.js +175 -0
- package/dist/storage/localSource.js.map +1 -0
- package/dist/storage/pulledComments.d.ts +81 -0
- package/dist/storage/pulledComments.js +107 -0
- package/dist/storage/pulledComments.js.map +1 -0
- package/dist/storage/remoteRecipe.d.ts +7 -0
- package/dist/storage/remoteRecipe.js +85 -0
- package/dist/storage/remoteRecipe.js.map +1 -0
- package/dist/storage/savedRemote.d.ts +2 -0
- package/dist/storage/savedRemote.js +22 -0
- package/dist/storage/savedRemote.js.map +1 -0
- package/dist/storage/sidecarAccess.d.ts +7 -0
- package/dist/storage/sidecarAccess.js +68 -0
- package/dist/storage/sidecarAccess.js.map +1 -0
- package/package.json +306 -4
|
@@ -0,0 +1,597 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react';
|
|
3
|
+
import { ActionSheetIOS, Alert, Platform, StyleSheet, View, useWindowDimensions } from 'react-native';
|
|
4
|
+
import { SafeAreaInsetsContext, initialWindowMetrics } from 'react-native-safe-area-context';
|
|
5
|
+
import { registerDevMenuItems } from 'ontrackd/rn-dev-menu';
|
|
6
|
+
import { runWhenIdle } from './idle.js';
|
|
7
|
+
import { localApi } from './api.js';
|
|
8
|
+
import { FilePickError, refusalText } from './attachments.js';
|
|
9
|
+
import { SelectionBar } from './Bars.js';
|
|
10
|
+
import { normalizedPinOffset, parseComments, parseReply } from './comments.js';
|
|
11
|
+
import { CommentThreadSheet } from './CommentThreadSheet.js';
|
|
12
|
+
import { CommentsSheet } from './CommentsSheet.js';
|
|
13
|
+
import { Highlight } from './Highlight.js';
|
|
14
|
+
import { Markers } from './MarkerPins.js';
|
|
15
|
+
import { measureCommentMarkers, selectionScope } from './markers.js';
|
|
16
|
+
import { anchorsToTranslate } from './movedAnchors.js';
|
|
17
|
+
import { reconcileThreadSelection } from './panel.js';
|
|
18
|
+
import { Toolbar } from './Toolbar.js';
|
|
19
|
+
import { devServerBase, fiberAt, frameOf, pickingAvailable, rootFiberOf } from './native.js';
|
|
20
|
+
import { initialNamePromptState, isTapGesture, reduceNamePrompt } from './interactions.js';
|
|
21
|
+
import { commentPayload } from './payload.js';
|
|
22
|
+
import { reviewerAvailable } from './runtimeConfig.js';
|
|
23
|
+
import { candidatesFrom } from './pick.js';
|
|
24
|
+
import { Composer, NamePrompt, SignInSheet } from './Sheet.js';
|
|
25
|
+
import { accountDisplayName } from './cloudSession.js';
|
|
26
|
+
import { signInMessage } from './signIn.js';
|
|
27
|
+
import { reviewerMessages, useCloudReviewer } from './useCloudReviewer.js';
|
|
28
|
+
import { initialState, reduce } from './state.js';
|
|
29
|
+
import { useComments } from './useComments.js';
|
|
30
|
+
import { useUploadDraft } from './useUploads.js';
|
|
31
|
+
/** What the attach menu calls each place it picks from. */
|
|
32
|
+
const sourceLabels = { library: 'Photos', camera: 'Camera', files: 'Files' };
|
|
33
|
+
const allSources = ['library', 'camera', 'files'];
|
|
34
|
+
const noInsets = { top: 0, bottom: 0, left: 0, right: 0 };
|
|
35
|
+
const newId = () => `${Date.now().toString(36)}${Math.random().toString(36).slice(2, 10)}`;
|
|
36
|
+
const pointOf = (event) => ({ x: event.nativeEvent.locationX, y: event.nativeEvent.locationY });
|
|
37
|
+
/**
|
|
38
|
+
* Wrap the app's root. In a dev bundle it adds the round button; in a release bundle Metro
|
|
39
|
+
* replaces this module with one that renders `children` and nothing else.
|
|
40
|
+
*
|
|
41
|
+
* `route` is the screen's path, for the comment's context: with expo-router, pass `usePathname()`.
|
|
42
|
+
*/
|
|
43
|
+
export function FeedbackProvider(props) {
|
|
44
|
+
const base = useMemo(() => devServerBase(), []);
|
|
45
|
+
const on = props.enabled !== false && reviewerAvailable(base) && pickingAvailable();
|
|
46
|
+
const reviewer = useCloudReviewer(base, on, props.adapter);
|
|
47
|
+
const cloud = reviewer.mode.phase === 'cloud';
|
|
48
|
+
const appRef = useRef(null);
|
|
49
|
+
const contextInsets = useContext(SafeAreaInsetsContext);
|
|
50
|
+
const insets = contextInsets ?? initialWindowMetrics?.insets ?? noInsets;
|
|
51
|
+
const screen = useWindowDimensions();
|
|
52
|
+
const [state, dispatch] = useReducer((reduce), undefined, () => initialState());
|
|
53
|
+
const [rect, setRect] = useState(null);
|
|
54
|
+
const [expanded, setExpanded] = useState(false);
|
|
55
|
+
const [toolbarCenter, setToolbarCenter] = useState(null);
|
|
56
|
+
const [markersVisible, setMarkersVisible] = useState(true);
|
|
57
|
+
const [panelOpen, setPanelOpen] = useState(false);
|
|
58
|
+
const [threadCommentId, setThreadCommentId] = useState(null);
|
|
59
|
+
const [filter, setFilter] = useState('open');
|
|
60
|
+
const [panelIds, setPanelIds] = useState(null);
|
|
61
|
+
const [activeCommentId, setActiveCommentId] = useState(null);
|
|
62
|
+
const [measuredMarkers, setMeasuredMarkers] = useState([]);
|
|
63
|
+
const markerGeneration = useRef(0);
|
|
64
|
+
const [localAuthor, setAuthor] = useState(null);
|
|
65
|
+
const author = cloud ? reviewer.author : localAuthor;
|
|
66
|
+
const [namePrompt, dispatchNamePrompt] = useReducer(reduceNamePrompt, undefined, initialNamePromptState);
|
|
67
|
+
const nameGeneration = useRef(0);
|
|
68
|
+
const namePending = useRef(false);
|
|
69
|
+
const authorWaiter = useRef(null);
|
|
70
|
+
const gesture = useRef(null);
|
|
71
|
+
// iOS drops a Modal presented while another is still sliding away, so the next one waits for onDismiss.
|
|
72
|
+
const panelAfterSignIn = useRef(false);
|
|
73
|
+
const threadAfterPanel = useRef(null);
|
|
74
|
+
const devMenuPick = useRef(() => { });
|
|
75
|
+
// Local mode talks to the sidecar exactly as before; cloud mode only once signed in.
|
|
76
|
+
const local = useMemo(() => (base && reviewer.mode.phase === 'local' ? localApi(base) : null), [base, reviewer.mode.phase]);
|
|
77
|
+
const api = local ?? reviewer.api;
|
|
78
|
+
const route = props.route ?? '/';
|
|
79
|
+
const routeRef = useRef(route);
|
|
80
|
+
const threadIdRef = useRef(threadCommentId);
|
|
81
|
+
routeRef.current = route;
|
|
82
|
+
threadIdRef.current = threadCommentId;
|
|
83
|
+
const { comments, routeComments, loading: commentsLoading, error: loadError, noteCreated, refresh: refreshComments, replaceComment, removeComment, restoreComment, appendReply, } = useComments(api, on, route);
|
|
84
|
+
const signedOut = cloud && !reviewer.session;
|
|
85
|
+
// The new comment's files and the reply's files: each uploads as soon as it is picked.
|
|
86
|
+
const commentFiles = useUploadDraft(api);
|
|
87
|
+
const replyFiles = useUploadDraft(api);
|
|
88
|
+
const clearCommentFiles = commentFiles.clear;
|
|
89
|
+
const clearReplyFiles = replyFiles.clear;
|
|
90
|
+
const pickFiles = props.adapter?.pickFiles ?? null;
|
|
91
|
+
const pickFrom = useMemo(() => (pickFiles ? (props.adapter?.pickSources ?? allSources) : []), [pickFiles, props.adapter?.pickSources]);
|
|
92
|
+
const commentsError = reviewer.mode.phase === 'unavailable' ? reviewer.mode.message
|
|
93
|
+
: signedOut ? reviewerMessages.signInToSee
|
|
94
|
+
: cloud && loadError ? signInMessage(new Error(loadError), 'Comments could not be loaded. Try again.')
|
|
95
|
+
: loadError;
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const waiter = authorWaiter.current;
|
|
98
|
+
if (waiter) {
|
|
99
|
+
authorWaiter.current = null;
|
|
100
|
+
namePending.current = false;
|
|
101
|
+
waiter(null);
|
|
102
|
+
dispatchNamePrompt({ type: 'cancel', generation: ++nameGeneration.current });
|
|
103
|
+
}
|
|
104
|
+
panelAfterSignIn.current = false;
|
|
105
|
+
threadAfterPanel.current = null;
|
|
106
|
+
setPanelOpen(false);
|
|
107
|
+
setThreadCommentId(null);
|
|
108
|
+
setPanelIds(null);
|
|
109
|
+
setActiveCommentId(null);
|
|
110
|
+
}, [route]);
|
|
111
|
+
// A lost session folds the plugin back to the bullet, the one place that asks for an email.
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
if (signedOut) {
|
|
114
|
+
setExpanded(false);
|
|
115
|
+
setPanelOpen(false);
|
|
116
|
+
setThreadCommentId(null);
|
|
117
|
+
}
|
|
118
|
+
}, [signedOut]);
|
|
119
|
+
const hasOpenComments = routeComments.some((comment) => comment.status === 'open');
|
|
120
|
+
const threadComment = useMemo(() => routeComments.find((comment) => comment.id === threadCommentId) ?? null, [routeComments, threadCommentId]);
|
|
121
|
+
useEffect(() => {
|
|
122
|
+
const reconciled = reconcileThreadSelection({ threadCommentId, activeCommentId }, routeComments);
|
|
123
|
+
if (reconciled.threadCommentId === threadCommentId)
|
|
124
|
+
return;
|
|
125
|
+
setThreadCommentId(reconciled.threadCommentId);
|
|
126
|
+
setActiveCommentId(reconciled.activeCommentId);
|
|
127
|
+
}, [activeCommentId, routeComments, threadCommentId]);
|
|
128
|
+
// A comment's chain is saved once and never changes, so it stays out of the signature: it is large.
|
|
129
|
+
const markerSignature = JSON.stringify(routeComments, (key, value) => key === 'anchorChain' ? undefined : value);
|
|
130
|
+
// Comments left on another build (each Metro run is one) name that build's ids: ask where they are now.
|
|
131
|
+
const currentBuild = reviewer.mode.phase === 'cloud' ? reviewer.mode.config.buildId : null;
|
|
132
|
+
const [moves, setMoves] = useState({ build: null, answers: new Map() });
|
|
133
|
+
const asked = useRef({ build: null, keys: new Set() });
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
if (asked.current.build !== currentBuild) {
|
|
136
|
+
asked.current = { build: currentBuild, keys: new Set() };
|
|
137
|
+
setMoves({ build: currentBuild, answers: new Map() });
|
|
138
|
+
}
|
|
139
|
+
const translate = api?.translateAnchors;
|
|
140
|
+
if (!on || !currentBuild || !translate)
|
|
141
|
+
return;
|
|
142
|
+
const wanted = anchorsToTranslate(routeComments, currentBuild, asked.current.keys);
|
|
143
|
+
if (wanted.length === 0)
|
|
144
|
+
return;
|
|
145
|
+
// Asked once: an unknown build, or a failed call, leaves those comments judged as before.
|
|
146
|
+
for (const entry of wanted)
|
|
147
|
+
asked.current.keys.add(`${entry.buildId}:${entry.anchorId}`);
|
|
148
|
+
const build = currentBuild;
|
|
149
|
+
void translate(build, wanted).then((answers) => {
|
|
150
|
+
if (!answers || answers.size === 0 || asked.current.build !== build)
|
|
151
|
+
return;
|
|
152
|
+
setMoves((previous) => previous.build === build ? { build, answers: new Map([...previous.answers, ...answers]) } : previous);
|
|
153
|
+
}).catch(() => { });
|
|
154
|
+
}, [on, api, currentBuild, markerSignature]);
|
|
155
|
+
// Steps of a journey kept on one screen change on a tap, with nothing else to say so: measure again.
|
|
156
|
+
const [measureTick, setMeasureTick] = useState(0);
|
|
157
|
+
const touchTimer = useRef(null);
|
|
158
|
+
const measuresOnTouch = on && routeComments.length > 0;
|
|
159
|
+
const onAppTouchEnd = useCallback(() => {
|
|
160
|
+
if (!measuresOnTouch)
|
|
161
|
+
return;
|
|
162
|
+
if (touchTimer.current)
|
|
163
|
+
clearTimeout(touchTimer.current);
|
|
164
|
+
touchTimer.current = setTimeout(() => {
|
|
165
|
+
touchTimer.current = null;
|
|
166
|
+
setMeasureTick((tick) => tick + 1);
|
|
167
|
+
}, 400);
|
|
168
|
+
}, [measuresOnTouch]);
|
|
169
|
+
useEffect(() => () => { if (touchTimer.current)
|
|
170
|
+
clearTimeout(touchTimer.current); }, []);
|
|
171
|
+
// A re-measure after a tap keeps the pins up until the new ones are known, so they don't blink.
|
|
172
|
+
const layoutKey = `${on}|${markerSignature}|${route}|${screen.width}x${screen.height}`;
|
|
173
|
+
const lastLayoutKey = useRef(null);
|
|
174
|
+
useEffect(() => {
|
|
175
|
+
const generation = ++markerGeneration.current;
|
|
176
|
+
if (lastLayoutKey.current !== layoutKey)
|
|
177
|
+
setMeasuredMarkers([]);
|
|
178
|
+
lastLayoutKey.current = layoutKey;
|
|
179
|
+
if (!on || routeComments.length === 0)
|
|
180
|
+
return;
|
|
181
|
+
let cancelled = false;
|
|
182
|
+
const task = runWhenIdle(() => {
|
|
183
|
+
if (cancelled || markerGeneration.current !== generation)
|
|
184
|
+
return;
|
|
185
|
+
const root = rootFiberOf(appRef.current);
|
|
186
|
+
if (!root)
|
|
187
|
+
return;
|
|
188
|
+
void measureCommentMarkers(root, appRef.current, routeComments, moves).then((markers) => {
|
|
189
|
+
if (!cancelled && markerGeneration.current === generation)
|
|
190
|
+
setMeasuredMarkers(markers);
|
|
191
|
+
}).catch(() => {
|
|
192
|
+
if (!cancelled && markerGeneration.current === generation)
|
|
193
|
+
setMeasuredMarkers([]);
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
return () => {
|
|
197
|
+
cancelled = true;
|
|
198
|
+
markerGeneration.current += 1;
|
|
199
|
+
task.cancel();
|
|
200
|
+
};
|
|
201
|
+
}, [on, markerSignature, route, screen.width, screen.height, moves, measureTick, layoutKey]);
|
|
202
|
+
const markerIds = useMemo(() => new Set(measuredMarkers.map((marker) => marker.comment.id)), [measuredMarkers]);
|
|
203
|
+
const activeMarker = useMemo(() => measuredMarkers.find((marker) => marker.comment.id === activeCommentId) ?? null, [measuredMarkers, activeCommentId]);
|
|
204
|
+
// Registered once, so the callback reads the current sign-in state through this ref.
|
|
205
|
+
devMenuPick.current = () => {
|
|
206
|
+
void (async () => {
|
|
207
|
+
if (signedOut && !(await reviewer.requestSignIn()))
|
|
208
|
+
return;
|
|
209
|
+
setExpanded(false);
|
|
210
|
+
setPanelOpen(false);
|
|
211
|
+
setThreadCommentId(null);
|
|
212
|
+
setActiveCommentId(null);
|
|
213
|
+
dispatch({ type: 'startPicking' });
|
|
214
|
+
})();
|
|
215
|
+
};
|
|
216
|
+
useEffect(() => {
|
|
217
|
+
if (!on)
|
|
218
|
+
return;
|
|
219
|
+
void registerDevMenuItems([{
|
|
220
|
+
name: 'Comment on this screen',
|
|
221
|
+
callback: () => devMenuPick.current(),
|
|
222
|
+
}]).catch(() => { });
|
|
223
|
+
}, [on]);
|
|
224
|
+
const selected = state.selection ? state.selection.candidates[state.selection.index] : null;
|
|
225
|
+
useEffect(() => {
|
|
226
|
+
let live = true;
|
|
227
|
+
if (!selected) {
|
|
228
|
+
setRect(null);
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
void frameOf(selected.fiber, appRef.current).then((frame) => { if (live)
|
|
232
|
+
setRect(frame); });
|
|
233
|
+
return () => { live = false; };
|
|
234
|
+
}, [selected]);
|
|
235
|
+
const selectAt = useCallback((point) => {
|
|
236
|
+
void fiberAt(appRef.current, point.x, point.y).then((fiber) => {
|
|
237
|
+
const candidates = fiber ? candidatesFrom(fiber) : [];
|
|
238
|
+
if (candidates.length)
|
|
239
|
+
dispatch({ type: 'select', candidates, point });
|
|
240
|
+
});
|
|
241
|
+
}, []);
|
|
242
|
+
const onGestureGrant = useCallback((event) => {
|
|
243
|
+
gesture.current = { grant: pointOf(event), moved: false };
|
|
244
|
+
}, []);
|
|
245
|
+
const onGestureMove = useCallback((event) => {
|
|
246
|
+
if (gesture.current && !isTapGesture(gesture.current.grant, pointOf(event)))
|
|
247
|
+
gesture.current.moved = true;
|
|
248
|
+
}, []);
|
|
249
|
+
const onGestureRelease = useCallback((event) => {
|
|
250
|
+
const tracked = gesture.current;
|
|
251
|
+
gesture.current = null;
|
|
252
|
+
const release = pointOf(event);
|
|
253
|
+
if (tracked && !tracked.moved && isTapGesture(tracked.grant, release))
|
|
254
|
+
selectAt(release);
|
|
255
|
+
}, [selectAt]);
|
|
256
|
+
const onGestureTerminate = useCallback(() => { gesture.current = null; }, []);
|
|
257
|
+
const requestAuthor = useCallback(async () => {
|
|
258
|
+
if (author)
|
|
259
|
+
return author;
|
|
260
|
+
if (cloud) {
|
|
261
|
+
const session = await reviewer.requestSignIn();
|
|
262
|
+
return session ? { id: session.account.id, name: accountDisplayName(session.account) } : null;
|
|
263
|
+
}
|
|
264
|
+
if (!local || namePending.current || authorWaiter.current)
|
|
265
|
+
return null;
|
|
266
|
+
const requestedRoute = routeRef.current;
|
|
267
|
+
const known = await local.identify().catch(() => null);
|
|
268
|
+
if (routeRef.current !== requestedRoute)
|
|
269
|
+
return null;
|
|
270
|
+
return new Promise((resolve) => {
|
|
271
|
+
authorWaiter.current = resolve;
|
|
272
|
+
dispatchNamePrompt({
|
|
273
|
+
type: 'open',
|
|
274
|
+
suggested: known?.participant?.name ?? null,
|
|
275
|
+
generation: ++nameGeneration.current,
|
|
276
|
+
});
|
|
277
|
+
});
|
|
278
|
+
}, [author, cloud, reviewer.requestSignIn, local]);
|
|
279
|
+
const compose = useCallback(async () => {
|
|
280
|
+
const participant = await requestAuthor();
|
|
281
|
+
if (participant)
|
|
282
|
+
dispatch({ type: 'compose' });
|
|
283
|
+
}, [requestAuthor]);
|
|
284
|
+
const editName = useCallback(() => {
|
|
285
|
+
if (cloud) {
|
|
286
|
+
reviewer.openSignIn();
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
if (!author || namePending.current)
|
|
290
|
+
return;
|
|
291
|
+
dispatchNamePrompt({ type: 'open', suggested: author.name, generation: ++nameGeneration.current });
|
|
292
|
+
}, [author, cloud, reviewer.openSignIn]);
|
|
293
|
+
const cancelName = useCallback(() => {
|
|
294
|
+
if (namePending.current)
|
|
295
|
+
return;
|
|
296
|
+
const waiter = authorWaiter.current;
|
|
297
|
+
authorWaiter.current = null;
|
|
298
|
+
dispatchNamePrompt({ type: 'cancel', generation: ++nameGeneration.current });
|
|
299
|
+
waiter?.(null);
|
|
300
|
+
}, []);
|
|
301
|
+
const named = useCallback(async (name) => {
|
|
302
|
+
if (!local || !namePrompt.visible || namePending.current)
|
|
303
|
+
return;
|
|
304
|
+
namePending.current = true;
|
|
305
|
+
const generation = ++nameGeneration.current;
|
|
306
|
+
dispatchNamePrompt({ type: 'submit', generation });
|
|
307
|
+
try {
|
|
308
|
+
const known = await local.identify().catch(() => null);
|
|
309
|
+
const id = known?.participant && known.participant.name === name ? known.participant.id : newId();
|
|
310
|
+
const saved = await local.saveParticipant(id, name);
|
|
311
|
+
if (nameGeneration.current !== generation)
|
|
312
|
+
return;
|
|
313
|
+
namePending.current = false;
|
|
314
|
+
dispatchNamePrompt({ type: 'succeeded', generation });
|
|
315
|
+
setAuthor(saved.participant);
|
|
316
|
+
const waiter = authorWaiter.current;
|
|
317
|
+
authorWaiter.current = null;
|
|
318
|
+
waiter?.(saved.participant);
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
if (nameGeneration.current !== generation)
|
|
322
|
+
return;
|
|
323
|
+
namePending.current = false;
|
|
324
|
+
dispatchNamePrompt({
|
|
325
|
+
type: 'failed',
|
|
326
|
+
generation,
|
|
327
|
+
message: error instanceof Error ? error.message : 'The name was not saved',
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}, [local, namePrompt.visible]);
|
|
331
|
+
const send = useCallback(async (body) => {
|
|
332
|
+
if (!api || !author || !state.selection)
|
|
333
|
+
return;
|
|
334
|
+
dispatch({ type: 'sending' });
|
|
335
|
+
try {
|
|
336
|
+
const candidate = state.selection.candidates[state.selection.index];
|
|
337
|
+
const frame = await frameOf(candidate.fiber, appRef.current);
|
|
338
|
+
if (!frame)
|
|
339
|
+
throw new Error('The selected element could not be measured');
|
|
340
|
+
const candidates = state.selection.candidates.map((item) => item.anchor);
|
|
341
|
+
const rootFiber = rootFiberOf(appRef.current);
|
|
342
|
+
const attachmentIds = commentFiles.ids;
|
|
343
|
+
const created = await api.createComment({
|
|
344
|
+
...commentPayload({
|
|
345
|
+
author,
|
|
346
|
+
body,
|
|
347
|
+
candidates,
|
|
348
|
+
index: state.selection.index,
|
|
349
|
+
route,
|
|
350
|
+
screen: { w: screen.width, h: screen.height },
|
|
351
|
+
pinOffset: normalizedPinOffset(state.selection.point, frame),
|
|
352
|
+
scope: rootFiber ? selectionScope(rootFiber, candidates, state.selection.index) : null,
|
|
353
|
+
}),
|
|
354
|
+
...(attachmentIds.length ? { attachmentIds } : {}),
|
|
355
|
+
});
|
|
356
|
+
const parsed = parseComments({ comments: [created.comment] })[0];
|
|
357
|
+
if (parsed)
|
|
358
|
+
noteCreated(parsed);
|
|
359
|
+
else
|
|
360
|
+
void refreshComments();
|
|
361
|
+
clearCommentFiles(true);
|
|
362
|
+
dispatch({ type: 'sent' });
|
|
363
|
+
}
|
|
364
|
+
catch (error) {
|
|
365
|
+
// The reviewer sees plain words; the developer sees the cause.
|
|
366
|
+
if (globalThis.__DEV__ === true)
|
|
367
|
+
console.warn('ontrackd: the comment was not saved.', error);
|
|
368
|
+
const fallback = error instanceof Error && !cloud ? error.message : 'The comment was not saved. Try again.';
|
|
369
|
+
dispatch({ type: 'failed', message: signInMessage(error, fallback) });
|
|
370
|
+
}
|
|
371
|
+
}, [api, author, cloud, state.selection, route, screen.width, screen.height, noteCreated, refreshComments, commentFiles.ids, clearCommentFiles]);
|
|
372
|
+
const replyToThread = useCallback(async (body) => {
|
|
373
|
+
const comment = threadComment;
|
|
374
|
+
const participant = await requestAuthor();
|
|
375
|
+
if (!api || !comment || !participant)
|
|
376
|
+
return { ok: false };
|
|
377
|
+
try {
|
|
378
|
+
const result = await api.addReply(comment.id, {
|
|
379
|
+
author: participant.name,
|
|
380
|
+
authorId: participant.id,
|
|
381
|
+
body: body.trim(),
|
|
382
|
+
anchor: comment.anchor,
|
|
383
|
+
...(replyFiles.ids.length ? { attachmentIds: replyFiles.ids } : {}),
|
|
384
|
+
});
|
|
385
|
+
const reply = parseReply(result.reply);
|
|
386
|
+
if (!reply)
|
|
387
|
+
throw new Error('Invalid reply response');
|
|
388
|
+
clearReplyFiles(true);
|
|
389
|
+
appendReply(comment.id, reply);
|
|
390
|
+
void refreshComments();
|
|
391
|
+
return { ok: true };
|
|
392
|
+
}
|
|
393
|
+
catch (error) {
|
|
394
|
+
return { ok: false, message: signInMessage(error, 'Not sent. Your reply is still here. Try again.') };
|
|
395
|
+
}
|
|
396
|
+
}, [api, threadComment, requestAuthor, appendReply, refreshComments, replyFiles.ids, clearReplyFiles]);
|
|
397
|
+
/** Saves a new text for the comment or one of its replies. Anchor and context stay as they were. */
|
|
398
|
+
const editThread = useCallback(async (target, body) => {
|
|
399
|
+
const previous = threadComment;
|
|
400
|
+
const text = body.trim();
|
|
401
|
+
if (!api || !previous || !text)
|
|
402
|
+
return { ok: false };
|
|
403
|
+
const editedAt = new Date().toISOString();
|
|
404
|
+
const withReply = (replyId, change) => ({
|
|
405
|
+
...previous,
|
|
406
|
+
replies: previous.replies.map((reply) => (reply.id === replyId ? change(reply) : reply)),
|
|
407
|
+
});
|
|
408
|
+
const { replyId } = target;
|
|
409
|
+
replaceComment(replyId === null
|
|
410
|
+
? { ...previous, body: text, editedAt }
|
|
411
|
+
: withReply(replyId, (reply) => ({ ...reply, body: text, editedAt })));
|
|
412
|
+
try {
|
|
413
|
+
if (replyId === null) {
|
|
414
|
+
const result = await api.updateComment(previous.id, { body: text });
|
|
415
|
+
const confirmed = parseComments({ comments: [result.comment] })[0];
|
|
416
|
+
if (confirmed)
|
|
417
|
+
replaceComment(confirmed);
|
|
418
|
+
}
|
|
419
|
+
else {
|
|
420
|
+
const result = await api.updateReply(previous.id, replyId, { body: text });
|
|
421
|
+
const confirmed = parseReply(result.reply);
|
|
422
|
+
if (confirmed)
|
|
423
|
+
replaceComment(withReply(replyId, () => confirmed));
|
|
424
|
+
}
|
|
425
|
+
void refreshComments();
|
|
426
|
+
return { ok: true };
|
|
427
|
+
}
|
|
428
|
+
catch (error) {
|
|
429
|
+
replaceComment(previous);
|
|
430
|
+
return { ok: false, message: signInMessage(error, 'Not saved. Try again.') };
|
|
431
|
+
}
|
|
432
|
+
}, [api, threadComment, replaceComment, refreshComments]);
|
|
433
|
+
/** Offers the places the app can pick files from, then uploads what the reviewer picked. */
|
|
434
|
+
const chooseFiles = useCallback((draft) => {
|
|
435
|
+
if (!pickFiles || pickFrom.length === 0)
|
|
436
|
+
return;
|
|
437
|
+
if (draft.room <= 0) {
|
|
438
|
+
draft.setNotice(refusalText('count'));
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
const room = draft.room;
|
|
442
|
+
const pick = async (source) => {
|
|
443
|
+
try {
|
|
444
|
+
const picked = await pickFiles(source, room);
|
|
445
|
+
if (picked.length)
|
|
446
|
+
draft.add(picked);
|
|
447
|
+
}
|
|
448
|
+
catch (error) {
|
|
449
|
+
draft.setNotice(error instanceof FilePickError ? error.message : 'Could not open your files');
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
if (pickFrom.length === 1) {
|
|
453
|
+
void pick(pickFrom[0]);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
if (Platform.OS === 'ios') {
|
|
457
|
+
ActionSheetIOS.showActionSheetWithOptions({ options: [...pickFrom.map((source) => sourceLabels[source]), 'Cancel'], cancelButtonIndex: pickFrom.length }, (index) => {
|
|
458
|
+
const source = pickFrom[index];
|
|
459
|
+
if (source)
|
|
460
|
+
void pick(source);
|
|
461
|
+
});
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
// Android shows at most three buttons: with three places, a tap outside cancels.
|
|
465
|
+
Alert.alert('Attach', undefined, [
|
|
466
|
+
...pickFrom.map((source) => ({ text: sourceLabels[source], onPress: () => void pick(source) })),
|
|
467
|
+
...(pickFrom.length < 3 ? [{ text: 'Cancel', style: 'cancel' }] : []),
|
|
468
|
+
], { cancelable: true });
|
|
469
|
+
}, [pickFiles, pickFrom]);
|
|
470
|
+
// Files picked for a comment or a thread that is gone are discarded: nothing can claim them.
|
|
471
|
+
const composing = state.phase === 'composing' || state.phase === 'sending';
|
|
472
|
+
useEffect(() => {
|
|
473
|
+
if (!composing)
|
|
474
|
+
clearCommentFiles(false);
|
|
475
|
+
}, [composing, clearCommentFiles]);
|
|
476
|
+
useEffect(() => {
|
|
477
|
+
clearReplyFiles(false);
|
|
478
|
+
}, [threadCommentId, clearReplyFiles]);
|
|
479
|
+
const toggleThreadStatus = useCallback(async () => {
|
|
480
|
+
const previous = threadComment;
|
|
481
|
+
if (!api || !previous)
|
|
482
|
+
return { ok: false };
|
|
483
|
+
const status = previous.status === 'open' ? 'resolved' : 'open';
|
|
484
|
+
replaceComment({ ...previous, status });
|
|
485
|
+
try {
|
|
486
|
+
const result = await api.updateComment(previous.id, { status });
|
|
487
|
+
const confirmed = parseComments({ comments: [result.comment] })[0];
|
|
488
|
+
if (confirmed)
|
|
489
|
+
replaceComment(confirmed);
|
|
490
|
+
void refreshComments();
|
|
491
|
+
return { ok: true };
|
|
492
|
+
}
|
|
493
|
+
catch (error) {
|
|
494
|
+
replaceComment(previous);
|
|
495
|
+
return {
|
|
496
|
+
ok: false,
|
|
497
|
+
message: signInMessage(error, status === 'resolved' ? 'Not marked done. Try again.' : 'Not reopened. Try again.'),
|
|
498
|
+
};
|
|
499
|
+
}
|
|
500
|
+
}, [api, threadComment, replaceComment, refreshComments]);
|
|
501
|
+
const deleteThread = useCallback(async () => {
|
|
502
|
+
const previous = threadComment;
|
|
503
|
+
if (!api || !previous)
|
|
504
|
+
return { ok: false };
|
|
505
|
+
const index = comments.findIndex((item) => item.id === previous.id);
|
|
506
|
+
const mutationRoute = route;
|
|
507
|
+
removeComment(previous.id);
|
|
508
|
+
setThreadCommentId(null);
|
|
509
|
+
setActiveCommentId(null);
|
|
510
|
+
try {
|
|
511
|
+
await api.deleteComment(previous.id);
|
|
512
|
+
void refreshComments();
|
|
513
|
+
return { ok: true };
|
|
514
|
+
}
|
|
515
|
+
catch (error) {
|
|
516
|
+
restoreComment(previous, index < 0 ? comments.length : index);
|
|
517
|
+
if (routeRef.current === mutationRoute && threadIdRef.current === null) {
|
|
518
|
+
setThreadCommentId(previous.id);
|
|
519
|
+
setActiveCommentId(previous.id);
|
|
520
|
+
}
|
|
521
|
+
return { ok: false, message: signInMessage(error, 'Not deleted. Try again.') };
|
|
522
|
+
}
|
|
523
|
+
}, [api, comments, route, threadComment, removeComment, restoreComment, refreshComments]);
|
|
524
|
+
const openMarkerComment = useCallback((id) => {
|
|
525
|
+
setExpanded(false);
|
|
526
|
+
setPanelOpen(false);
|
|
527
|
+
setPanelIds(null);
|
|
528
|
+
setActiveCommentId(id);
|
|
529
|
+
setThreadCommentId(id);
|
|
530
|
+
}, []);
|
|
531
|
+
const openMarkerGroup = useCallback((ids) => {
|
|
532
|
+
setExpanded(false);
|
|
533
|
+
setThreadCommentId(null);
|
|
534
|
+
setActiveCommentId(null);
|
|
535
|
+
setPanelIds(new Set(ids));
|
|
536
|
+
setPanelOpen(true);
|
|
537
|
+
}, []);
|
|
538
|
+
const focusComment = useCallback((id) => {
|
|
539
|
+
setPanelOpen(false);
|
|
540
|
+
setActiveCommentId(id);
|
|
541
|
+
if (Platform.OS === 'ios') {
|
|
542
|
+
threadAfterPanel.current = id;
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
setThreadCommentId(id);
|
|
546
|
+
}, []);
|
|
547
|
+
const panelDismissed = useCallback(() => {
|
|
548
|
+
const id = threadAfterPanel.current;
|
|
549
|
+
threadAfterPanel.current = null;
|
|
550
|
+
if (id)
|
|
551
|
+
setThreadCommentId(id);
|
|
552
|
+
}, []);
|
|
553
|
+
const openPanelAfterSignIn = useCallback(() => {
|
|
554
|
+
if (!panelAfterSignIn.current)
|
|
555
|
+
return;
|
|
556
|
+
panelAfterSignIn.current = false;
|
|
557
|
+
setThreadCommentId(null);
|
|
558
|
+
setPanelIds(null);
|
|
559
|
+
setPanelOpen(true);
|
|
560
|
+
}, []);
|
|
561
|
+
// As on web: the bullet is where a signed-out reviewer is asked for an email, and signing in lands on the list.
|
|
562
|
+
const openFromBullet = useCallback(async () => {
|
|
563
|
+
if (!signedOut) {
|
|
564
|
+
setExpanded(true);
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
567
|
+
const session = await reviewer.requestSignIn();
|
|
568
|
+
if (!session)
|
|
569
|
+
return;
|
|
570
|
+
setExpanded(true);
|
|
571
|
+
panelAfterSignIn.current = true;
|
|
572
|
+
if (Platform.OS !== 'ios')
|
|
573
|
+
openPanelAfterSignIn();
|
|
574
|
+
}, [signedOut, reviewer.requestSignIn, openPanelAfterSignIn]);
|
|
575
|
+
if (!on)
|
|
576
|
+
return _jsx(_Fragment, { children: props.children });
|
|
577
|
+
const capturing = (state.phase === 'picking' || state.phase === 'selected') && !panelOpen;
|
|
578
|
+
return (_jsxs(View, { style: styles.fill, children: [_jsx(View, { ref: appRef, style: styles.fill, collapsable: false, onTouchEnd: onAppTouchEnd, children: props.children }), markersVisible ? (_jsx(Markers, { markers: measuredMarkers, activeId: activeCommentId, onOpenComment: openMarkerComment, onOpenGroup: openMarkerGroup })) : null, capturing ? (_jsx(View, { style: StyleSheet.absoluteFill, onStartShouldSetResponder: () => true, onResponderGrant: onGestureGrant, onResponderMove: onGestureMove, onResponderRelease: onGestureRelease, onResponderTerminate: onGestureTerminate })) : null, rect && state.phase !== 'idle' ? _jsx(Highlight, { rect: rect }) : null, markersVisible && activeMarker && state.phase === 'idle' && !panelOpen ? (_jsx(Highlight, { rect: activeMarker.frame })) : null, state.phase === 'idle' || state.phase === 'picking' || state.phase === 'selected' ? (_jsx(Toolbar, { insets: insets, center: toolbarCenter, expanded: expanded, commenting: state.phase !== 'idle', markersVisible: markersVisible, hasOpenComments: hasOpenComments, author: author, onExpand: () => void openFromBullet(), onAdd: () => {
|
|
579
|
+
setExpanded(false);
|
|
580
|
+
setThreadCommentId(null);
|
|
581
|
+
setActiveCommentId(null);
|
|
582
|
+
dispatch({ type: 'startPicking' });
|
|
583
|
+
}, onToggleMarkers: () => setMarkersVisible((visible) => !visible), onComments: () => {
|
|
584
|
+
setExpanded(false);
|
|
585
|
+
setThreadCommentId(null);
|
|
586
|
+
setPanelIds(null);
|
|
587
|
+
setPanelOpen(true);
|
|
588
|
+
}, onAvatar: editName, avatarLabel: cloud ? 'Your account' : undefined, onCollapse: () => setExpanded(false), onStop: () => {
|
|
589
|
+
setExpanded(false);
|
|
590
|
+
dispatch({ type: 'stop' });
|
|
591
|
+
}, onPosition: setToolbarCenter })) : null, state.phase === 'selected' && state.selection && rect ? (_jsx(SelectionBar, { rect: rect, canParent: state.selection.index < state.selection.candidates.length - 1, canChild: state.selection.index > 0, onParent: () => dispatch({ type: 'parent' }), onChild: () => dispatch({ type: 'child' }), onComment: () => void compose() })) : null, _jsx(CommentsSheet, { visible: panelOpen, comments: routeComments, filter: filter, filteredIds: panelIds, markerIds: markerIds, loading: commentsLoading, error: commentsError, onClose: () => setPanelOpen(false), onFilter: setFilter, onRetry: () => (signedOut ? reviewer.openSignIn() : void refreshComments()), retryLabel: signedOut ? 'Sign in' : undefined, onShowAll: () => setPanelIds(null), onFocus: focusComment, onDismissed: panelDismissed }), _jsx(CommentThreadSheet, { comment: threadComment, visible: threadComment !== null, me: author?.id ?? null, onReply: replyToThread, onEdit: editThread, files: replyFiles.files, fileNotice: replyFiles.notice, uploading: replyFiles.uploading, onAttach: pickFrom.length ? () => chooseFiles(replyFiles) : null, onRemoveFile: replyFiles.remove, onDropFiles: () => clearReplyFiles(false), attachmentSource: (commentId, attachmentId) => api?.attachmentSource(commentId, attachmentId) ?? null, onToggleStatus: toggleThreadStatus, onDelete: deleteThread, onClose: () => {
|
|
592
|
+
setThreadCommentId(null);
|
|
593
|
+
setActiveCommentId(null);
|
|
594
|
+
} }), _jsx(Composer, { visible: state.phase === 'composing' || state.phase === 'sending', bottom: insets.bottom, sending: state.phase === 'sending', error: state.error, onCancel: () => dispatch({ type: 'cancelDraft' }), onSend: (body) => void send(body), files: commentFiles.files, notice: commentFiles.notice, uploading: commentFiles.uploading, onAttach: pickFrom.length ? () => chooseFiles(commentFiles) : null, onRemoveFile: commentFiles.remove }, `${state.selectionRevision}:${state.selection?.index ?? 'none'}`), _jsx(NamePrompt, { visible: namePrompt.visible, bottom: insets.bottom, suggested: namePrompt.suggested, pending: namePrompt.pending, error: namePrompt.error, onCancel: cancelName, onDone: (name) => void named(name) }, namePrompt.visible ? `ask-${namePrompt.suggested ?? ''}` : 'idle'), cloud ? (_jsx(SignInSheet, { visible: reviewer.signIn.visible, top: insets.top, bottom: insets.bottom, step: reviewer.signIn.step, email: reviewer.signIn.email, pending: reviewer.signIn.pending, error: reviewer.signIn.error, account: reviewer.session && reviewer.author ? { name: reviewer.author.name, email: reviewer.session.account.email } : null, onCancel: reviewer.closeSignIn, onEmail: (email) => void reviewer.submitEmail(email), onCode: (code) => void reviewer.submitCode(code), onChangeEmail: reviewer.changeEmail, onSignOut: () => void reviewer.signOut(), onDismissed: openPanelAfterSignIn })) : null] }));
|
|
595
|
+
}
|
|
596
|
+
const styles = StyleSheet.create({ fill: { flex: 1 } });
|
|
597
|
+
//# sourceMappingURL=Provider.js.map
|