@tonyclaw/agent-inspector 3.0.44 → 3.0.46
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/.output/{nitro.json → backend/nitro.json} +3 -3
- package/.output/backend-public/assets/index-D4LX-sw-.js +11 -0
- package/.output/cli.js +22707 -17099
- package/.output/server/_libs/extend.mjs +4 -8
- package/.output/server/_libs/jszip.mjs +9 -35
- package/.output/server/_libs/modelcontextprotocol__core.mjs +25 -25
- package/.output/server/_libs/modelcontextprotocol__server.mjs +2 -2
- package/.output/server/_libs/react-dom.mjs +2 -3
- package/.output/server/_libs/react.mjs +1 -27
- package/.output/server/_libs/tanstack__react-router.mjs +1 -329
- package/.output/server/_libs/tanstack__router-core.mjs +42 -100
- package/.output/server/_libs/use-sync-external-store.mjs +1 -64
- package/.output/server/_libs/ws.mjs +1 -1
- package/.output/server/_libs/zod.mjs +6 -6
- package/.output/server/_ssr/index.mjs +5 -4
- package/.output/server/_ssr/publicBasePathContext-IH2ilOfu.mjs +176 -0
- package/.output/server/_ssr/{router-DWcUFPR3.mjs → router-D18yUq36.mjs} +7877 -5597
- package/.output/server/_ssr/start-COQu_AgD.mjs +57 -0
- package/.output/server/_tanstack-start-manifest_v-DnbdNeun.mjs +4 -0
- package/.output/server/index.mjs +5 -145
- package/.output/{public/assets/CompareDrawer-DQHjxFO6.js → ui/assets/CompareDrawer-DAUuIJ6G.js} +1 -1
- package/.output/{public/assets/InspectorPet-D1A4505B.js → ui/assets/InspectorPet-BRBVjOWI.js} +1 -1
- package/.output/ui/assets/ProxyViewerContainer-D7Sq0ctc.js +59 -0
- package/.output/{public/assets/ReplayDialog-C5vmbecv.js → ui/assets/ReplayDialog-nDLsjOhs.js} +1 -1
- package/.output/{public/assets/RequestAnatomy-CPGNB8lk.js → ui/assets/RequestAnatomy-zd4BDgL0.js} +1 -1
- package/.output/ui/assets/ResponseView-AdIXGcSn.js +2 -0
- package/.output/ui/assets/StreamingChunkSequence-CesTz8He.js +1 -0
- package/.output/{public/assets/_sessionId-CDhRgzf6.js → ui/assets/_sessionId-BAfzrhSU.js} +1 -1
- package/.output/{public/assets/_sessionId-mw3aA8Bp.js → ui/assets/_sessionId-QnBomgPD.js} +1 -1
- package/.output/ui/assets/favicon-DYEkHSNl.svg +21 -0
- package/.output/{public/assets/index-B2eoeT-Z.js → ui/assets/index-BcsdxBAd.js} +1 -1
- package/.output/ui/assets/index-BvXp42al.css +1 -0
- package/.output/{public/assets/index-CX7_rf7o.js → ui/assets/index-D0rtCN9V.js} +1 -1
- package/.output/ui/assets/index-DHpwr08Z.js +73 -0
- package/.output/{public/assets/index-BfRhTvOd.js → ui/assets/index-dNuk2dsU.js} +1 -1
- package/.output/ui/assets/json-viewer-BvFHglMb.js +1 -0
- package/.output/{public/assets/jszip.min-C9rCFoU3.js → ui/assets/jszip.min-B5Z7gNZB.js} +1 -1
- package/.output/ui/index.html +229 -0
- package/.output/ui/runtime-config.js +2 -0
- package/.output/workers/logFinalizer.worker.js +983 -414
- package/.output/workers/sessionWorkerEntry.js +983 -414
- package/README.md +363 -35
- package/docs/instance-control.openapi.yaml +361 -0
- package/package.json +28 -5
- package/scripts/generate-theme-scales.mjs +3 -3
- package/src/{router.tsx → backend/router.tsx} +3 -15
- package/src/backend/routes/$.ts +26 -0
- package/src/backend/routes/__root.ts +4 -0
- package/src/backend/routes/api/-instances.ts +109 -0
- package/src/{routes → backend/routes}/api/alerts.summary.ts +3 -3
- package/src/{routes → backend/routes}/api/alerts.ts +4 -4
- package/src/{routes → backend/routes}/api/config.paths.ts +1 -1
- package/src/{routes → backend/routes}/api/config.ts +11 -2
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.help.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.install.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.runner-presets.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.$packageId.upgrade.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.packages.ts +5 -1
- package/src/{routes → backend/routes}/api/ecosystem.recipes.$recipeId.run.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.tasks.$taskId.ts +1 -1
- package/src/{routes → backend/routes}/api/ecosystem.tasks.ts +1 -1
- package/src/{routes → backend/routes}/api/groups.$groupId.evidence.ts +2 -2
- package/src/{routes → backend/routes}/api/groups.$groupId.sessions.ts +2 -2
- package/src/{routes → backend/routes}/api/groups.$groupId.ts +2 -2
- package/src/{routes → backend/routes}/api/groups.ts +2 -2
- package/src/{routes → backend/routes}/api/health.ts +3 -3
- package/src/backend/routes/api/instances.$name.connection.ts +12 -0
- package/src/backend/routes/api/instances.$name.restart.ts +23 -0
- package/src/backend/routes/api/instances.$name.start.ts +18 -0
- package/src/backend/routes/api/instances.$name.stop.ts +23 -0
- package/src/backend/routes/api/instances.$name.ts +12 -0
- package/src/backend/routes/api/instances.ts +16 -0
- package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.promote.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.candidates.$candidateId.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.candidates.ts +1 -1
- package/src/{routes → backend/routes}/api/knowledge.project-context.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.search.ts +2 -2
- package/src/{routes → backend/routes}/api/knowledge.sessions.$sessionId.candidates.ts +3 -3
- package/src/{routes → backend/routes}/api/logs.$id.body.ts +6 -6
- package/src/{routes → backend/routes}/api/logs.$id.chunks.ts +5 -4
- package/src/{routes → backend/routes}/api/logs.$id.replay.ts +12 -11
- package/src/{routes → backend/routes}/api/logs.$id.ts +4 -3
- package/src/{routes → backend/routes}/api/logs.import.ts +3 -3
- package/src/{routes → backend/routes}/api/logs.stream.ts +11 -7
- package/src/{routes → backend/routes}/api/logs.ts +17 -9
- package/src/{routes → backend/routes}/api/mcp.ts +1 -1
- package/src/{routes → backend/routes}/api/models.ts +1 -1
- package/src/{routes → backend/routes}/api/pi-agent.ts +2 -2
- package/src/{routes → backend/routes}/api/providers.$providerId.model-metadata.ts +5 -5
- package/src/{routes → backend/routes}/api/providers.$providerId.test.log.ts +7 -7
- package/src/{routes → backend/routes}/api/providers.$providerId.ts +4 -4
- package/src/{routes → backend/routes}/api/providers.export.ts +1 -1
- package/src/{routes → backend/routes}/api/providers.import.ts +3 -3
- package/src/{routes → backend/routes}/api/providers.scan.ts +2 -2
- package/src/{routes → backend/routes}/api/providers.ts +9 -4
- package/src/{routes → backend/routes}/api/runs.$runId.evidence.ts +2 -2
- package/src/{routes → backend/routes}/api/runs.$runId.ts +2 -2
- package/src/{routes → backend/routes}/api/runs.ts +4 -4
- package/src/backend/routes/api/runtime.ts +46 -0
- package/src/{routes → backend/routes}/api/sessions.ts +3 -3
- package/src/{routes → backend/routes}/proxy/$.ts +1 -1
- package/src/{routes → backend/routes}/readyz.ts +1 -1
- package/src/backend/start.ts +10 -0
- package/src/cli/alias.ts +431 -0
- package/src/cli/doctor.ts +32 -9
- package/src/cli/instance.ts +1050 -0
- package/src/cli/instanceArgs.ts +285 -0
- package/src/cli/instanceControl.ts +181 -0
- package/src/cli/instanceModel.ts +267 -0
- package/src/cli/instanceRegistry.ts +731 -0
- package/src/cli/networkHints.ts +27 -14
- package/src/cli/onboard.ts +190 -35
- package/src/cli/onboardTarget.ts +228 -0
- package/src/cli/templates/codex-skill-onboard.ts +109 -31
- package/src/cli/templates/skill-onboard.ts +140 -70
- package/src/cli.ts +338 -77
- package/src/components/ProxyViewer.tsx +20 -10
- package/src/components/ProxyViewerContainer.tsx +12 -11
- package/src/components/pi-agent/PiAgentPanel.tsx +2 -2
- package/src/components/providers/ProviderCard.tsx +1 -1
- package/src/components/providers/ProviderTestResultsView.tsx +1 -1
- package/src/components/providers/SettingsDialog.tsx +160 -140
- package/src/components/proxy-viewer/ApplicationBar.tsx +2 -1
- package/src/components/proxy-viewer/LogEntry.tsx +1 -1
- package/src/components/proxy-viewer/log-formats/index.ts +1 -1
- package/src/contracts/index.ts +5 -0
- package/src/contracts/log.ts +33 -3
- package/src/knowledge/types.ts +3 -2
- package/src/lib/alertContract.ts +2 -2
- package/src/lib/apiClient.ts +30 -7
- package/src/lib/apiFormat.ts +29 -0
- package/src/lib/basePath.ts +31 -7
- package/src/lib/browserRuntimeContract.ts +124 -0
- package/src/lib/browserRuntimeResolver.ts +244 -0
- package/src/{proxy → lib}/claudeCodeStrip.ts +6 -7
- package/src/lib/codingAgentEndpoints.ts +54 -0
- package/src/lib/instanceContract.ts +236 -0
- package/src/lib/managedInstance.ts +104 -0
- package/src/lib/piAgentContract.ts +3 -2
- package/src/lib/publicBasePathContext.ts +137 -0
- package/src/lib/resourceLimits.ts +2 -0
- package/src/lib/runContract.ts +3 -3
- package/src/lib/sessionInfoContract.ts +3 -2
- package/src/mcp/instanceHandlers.ts +150 -0
- package/src/mcp/loopback.ts +16 -5
- package/src/mcp/mode.ts +25 -0
- package/src/mcp/server.ts +274 -39
- package/src/mcp/toolHandlers.ts +2 -2
- package/src/proxy/config.ts +25 -30
- package/src/proxy/dataDir.ts +43 -7
- package/src/proxy/ecosystemTasks.ts +161 -70
- package/src/proxy/formats/registry.ts +6 -21
- package/src/proxy/handler.ts +129 -29
- package/src/proxy/identityProxy.ts +1049 -50
- package/src/proxy/jsonlRecovery.ts +554 -0
- package/src/proxy/logFinalizer.ts +25 -10
- package/src/proxy/logImporter.ts +2 -1
- package/src/proxy/logIndex.ts +191 -95
- package/src/proxy/logger.ts +77 -14
- package/src/proxy/platformCommands.ts +41 -0
- package/src/proxy/privateDataPath.ts +310 -88
- package/src/proxy/rawStreamCapture.ts +194 -13
- package/src/proxy/runtimeAdmission.ts +5 -2
- package/src/proxy/runtimeHealth.ts +14 -1
- package/src/proxy/runtimeShutdown.ts +84 -2
- package/src/proxy/schemas.ts +7 -1
- package/src/proxy/sessionArchive.ts +78 -14
- package/src/proxy/sessionInfo.ts +5 -4
- package/src/proxy/sqliteLogIndex.ts +65 -2
- package/src/proxy/store.ts +141 -34
- package/src/proxy/uiAssetServer.ts +106 -0
- package/src/proxy/upstream.ts +29 -2
- package/src/ui/bootstrap.ts +167 -0
- package/src/ui/index.html +38 -0
- package/src/ui/logsStreamClient.ts +20 -0
- package/src/ui/main.tsx +13 -0
- package/src/ui/public/runtime-config.js +2 -0
- package/src/ui/router.tsx +13 -0
- package/src/ui/routes/__root.tsx +69 -0
- package/src/{routes → ui/routes}/index.tsx +2 -3
- package/src/{routes → ui/routes}/session/$sessionId.tsx +5 -11
- package/src/ui/runtimeDiscovery.ts +50 -0
- package/styles/globals.css +1 -0
- package/.output/public/assets/ProxyViewerContainer-BhpIgfBi.js +0 -126
- package/.output/public/assets/ResponseView-DUfrajCm.js +0 -2
- package/.output/public/assets/StreamingChunkSequence-nbeCQqOz.js +0 -1
- package/.output/public/assets/index-BWjeqxbk.css +0 -1
- package/.output/public/assets/index-C6qZwYlR.js +0 -70
- package/.output/public/assets/json-viewer-BLmF1sOZ.js +0 -1
- package/.output/server/_libs/@radix-ui/react-accessible-icon+[...].mjs +0 -1
- package/.output/server/_libs/@radix-ui/react-dismissable-layer+[...].mjs +0 -344
- package/.output/server/_libs/@radix-ui/react-navigation-menu+[...].mjs +0 -2
- package/.output/server/_libs/@radix-ui/react-one-time-password-field+[...].mjs +0 -2
- package/.output/server/_libs/@radix-ui/react-password-toggle-field+[...].mjs +0 -2
- package/.output/server/_libs/@radix-ui/react-use-callback-ref+[...].mjs +0 -11
- package/.output/server/_libs/@radix-ui/react-use-controllable-state+[...].mjs +0 -69
- package/.output/server/_libs/@radix-ui/react-use-effect-event+[...].mjs +0 -1
- package/.output/server/_libs/@radix-ui/react-use-is-hydrated+[...].mjs +0 -28
- package/.output/server/_libs/@radix-ui/react-use-layout-effect+[...].mjs +0 -6
- package/.output/server/_libs/@radix-ui/react-visually-hidden+[...].mjs +0 -34
- package/.output/server/_libs/aria-hidden.mjs +0 -122
- package/.output/server/_libs/bail.mjs +0 -8
- package/.output/server/_libs/character-entities.mjs +0 -2130
- package/.output/server/_libs/class-variance-authority.mjs +0 -44
- package/.output/server/_libs/clsx.mjs +0 -16
- package/.output/server/_libs/comma-separated-tokens.mjs +0 -10
- package/.output/server/_libs/decode-named-character-reference+[...].mjs +0 -8
- package/.output/server/_libs/dequal.mjs +0 -27
- package/.output/server/_libs/detect-node-es.mjs +0 -1
- package/.output/server/_libs/devlop.mjs +0 -8
- package/.output/server/_libs/diff.mjs +0 -320
- package/.output/server/_libs/estree-util-is-identifier-name.mjs +0 -11
- package/.output/server/_libs/floating-ui__core.mjs +0 -725
- package/.output/server/_libs/floating-ui__dom.mjs +0 -622
- package/.output/server/_libs/floating-ui__react-dom.mjs +0 -292
- package/.output/server/_libs/floating-ui__utils.mjs +0 -320
- package/.output/server/_libs/get-nonce.mjs +0 -9
- package/.output/server/_libs/hast-util-to-jsx-runtime.mjs +0 -388
- package/.output/server/_libs/hast-util-whitespace.mjs +0 -10
- package/.output/server/_libs/html-url-attributes.mjs +0 -26
- package/.output/server/_libs/inline-style-parser.mjs +0 -142
- package/.output/server/_libs/is-plain-obj.mjs +0 -10
- package/.output/server/_libs/lucide-react.mjs +0 -1027
- package/.output/server/_libs/mdast-util-from-markdown.mjs +0 -717
- package/.output/server/_libs/mdast-util-to-hast.mjs +0 -710
- package/.output/server/_libs/mdast-util-to-string.mjs +0 -38
- package/.output/server/_libs/micromark-core-commonmark.mjs +0 -2259
- package/.output/server/_libs/micromark-factory-destination.mjs +0 -94
- package/.output/server/_libs/micromark-factory-label.mjs +0 -63
- package/.output/server/_libs/micromark-factory-space.mjs +0 -24
- package/.output/server/_libs/micromark-factory-title.mjs +0 -65
- package/.output/server/_libs/micromark-factory-whitespace.mjs +0 -22
- package/.output/server/_libs/micromark-util-character.mjs +0 -44
- package/.output/server/_libs/micromark-util-chunked.mjs +0 -36
- package/.output/server/_libs/micromark-util-classify-character+[...].mjs +0 -12
- package/.output/server/_libs/micromark-util-combine-extensions+[...].mjs +0 -41
- package/.output/server/_libs/micromark-util-decode-numeric-character-reference+[...].mjs +0 -19
- package/.output/server/_libs/micromark-util-decode-string.mjs +0 -21
- package/.output/server/_libs/micromark-util-encode.mjs +0 -1
- package/.output/server/_libs/micromark-util-html-tag-name.mjs +0 -69
- package/.output/server/_libs/micromark-util-normalize-identifier+[...].mjs +0 -6
- package/.output/server/_libs/micromark-util-resolve-all.mjs +0 -15
- package/.output/server/_libs/micromark-util-sanitize-uri.mjs +0 -41
- package/.output/server/_libs/micromark-util-subtokenize.mjs +0 -346
- package/.output/server/_libs/micromark.mjs +0 -906
- package/.output/server/_libs/property-information.mjs +0 -1209
- package/.output/server/_libs/radix-ui.mjs +0 -1
- package/.output/server/_libs/radix-ui__number.mjs +0 -6
- package/.output/server/_libs/radix-ui__primitive.mjs +0 -11
- package/.output/server/_libs/radix-ui__react-accordion.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-alert-dialog.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-arrow.mjs +0 -23
- package/.output/server/_libs/radix-ui__react-aspect-ratio.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-avatar.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-checkbox.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-collapsible.mjs +0 -144
- package/.output/server/_libs/radix-ui__react-collection.mjs +0 -69
- package/.output/server/_libs/radix-ui__react-compose-refs.mjs +0 -38
- package/.output/server/_libs/radix-ui__react-context-menu.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-context.mjs +0 -64
- package/.output/server/_libs/radix-ui__react-dialog.mjs +0 -280
- package/.output/server/_libs/radix-ui__react-direction.mjs +0 -9
- package/.output/server/_libs/radix-ui__react-dropdown-menu.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-focus-guards.mjs +0 -39
- package/.output/server/_libs/radix-ui__react-focus-scope.mjs +0 -210
- package/.output/server/_libs/radix-ui__react-form.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-hover-card.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-id.mjs +0 -14
- package/.output/server/_libs/radix-ui__react-label.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-menu.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-menubar.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-popover.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-popper.mjs +0 -340
- package/.output/server/_libs/radix-ui__react-portal.mjs +0 -16
- package/.output/server/_libs/radix-ui__react-presence.mjs +0 -173
- package/.output/server/_libs/radix-ui__react-primitive.mjs +0 -42
- package/.output/server/_libs/radix-ui__react-progress.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-radio-group.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-roving-focus.mjs +0 -235
- package/.output/server/_libs/radix-ui__react-scroll-area.mjs +0 -731
- package/.output/server/_libs/radix-ui__react-select.mjs +0 -1207
- package/.output/server/_libs/radix-ui__react-separator.mjs +0 -28
- package/.output/server/_libs/radix-ui__react-slider.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-slot.mjs +0 -132
- package/.output/server/_libs/radix-ui__react-switch.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-tabs.mjs +0 -194
- package/.output/server/_libs/radix-ui__react-toast.mjs +0 -2
- package/.output/server/_libs/radix-ui__react-toggle-group.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-toggle.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-toolbar.mjs +0 -1
- package/.output/server/_libs/radix-ui__react-tooltip.mjs +0 -498
- package/.output/server/_libs/radix-ui__react-use-previous.mjs +0 -14
- package/.output/server/_libs/radix-ui__react-use-size.mjs +0 -39
- package/.output/server/_libs/react-markdown.mjs +0 -235
- package/.output/server/_libs/react-remove-scroll-bar.mjs +0 -82
- package/.output/server/_libs/react-remove-scroll.mjs +0 -328
- package/.output/server/_libs/react-style-singleton.mjs +0 -69
- package/.output/server/_libs/remark-parse.mjs +0 -19
- package/.output/server/_libs/remark-rehype.mjs +0 -21
- package/.output/server/_libs/space-separated-tokens.mjs +0 -6
- package/.output/server/_libs/style-to-js.mjs +0 -72
- package/.output/server/_libs/style-to-object.mjs +0 -38
- package/.output/server/_libs/swr.mjs +0 -947
- package/.output/server/_libs/tailwind-merge.mjs +0 -3255
- package/.output/server/_libs/tanstack__react-virtual.mjs +0 -130
- package/.output/server/_libs/tanstack__virtual-core.mjs +0 -1319
- package/.output/server/_libs/three.mjs +0 -26016
- package/.output/server/_libs/trim-lines.mjs +0 -41
- package/.output/server/_libs/trough.mjs +0 -85
- package/.output/server/_libs/tslib.mjs +0 -1
- package/.output/server/_libs/ungap__structured-clone.mjs +0 -212
- package/.output/server/_libs/unified.mjs +0 -661
- package/.output/server/_libs/unist-util-is.mjs +0 -100
- package/.output/server/_libs/unist-util-position.mjs +0 -27
- package/.output/server/_libs/unist-util-stringify-position.mjs +0 -27
- package/.output/server/_libs/unist-util-visit-parents.mjs +0 -82
- package/.output/server/_libs/unist-util-visit.mjs +0 -24
- package/.output/server/_libs/use-callback-ref.mjs +0 -66
- package/.output/server/_libs/use-sidecar.mjs +0 -106
- package/.output/server/_libs/vfile-message.mjs +0 -138
- package/.output/server/_libs/vfile.mjs +0 -467
- package/.output/server/_sessionId-E_Dmopc-.mjs +0 -144
- package/.output/server/_sessionId-U54BAqdp.mjs +0 -82
- package/.output/server/_ssr/CompareDrawer-CksatPed.mjs +0 -1058
- package/.output/server/_ssr/InspectorPet-DNc4GQ7z.mjs +0 -936
- package/.output/server/_ssr/ProxyViewerContainer-B02Ey0p_.mjs +0 -17607
- package/.output/server/_ssr/ReplayDialog-DdMvHJF1.mjs +0 -723
- package/.output/server/_ssr/RequestAnatomy--vh2Z8__.mjs +0 -835
- package/.output/server/_ssr/ResponseView-Dhxc-cKC.mjs +0 -755
- package/.output/server/_ssr/StreamingChunkSequence-BG0EQmaD.mjs +0 -272
- package/.output/server/_ssr/index-D0At9nfd.mjs +0 -82
- package/.output/server/_ssr/index-lcfulIXa.mjs +0 -133
- package/.output/server/_ssr/json-viewer-My1J1_5R.mjs +0 -481
- package/.output/server/_ssr/start-HYkvq4Ni.mjs +0 -4
- package/.output/server/_tanstack-start-manifest_v-B2chR8ef.mjs +0 -4
- package/.output/server/node_modules/tslib/modules/index.js +0 -70
- package/.output/server/node_modules/tslib/modules/package.json +0 -3
- package/.output/server/node_modules/tslib/package.json +0 -47
- package/.output/server/node_modules/tslib/tslib.js +0 -484
- package/.output/server/package.json +0 -9
- package/src/routes/__root.tsx +0 -170
- /package/.output/{public → ui}/assets/agent-inspector-58K1_MsC.ico +0 -0
- /package/.output/{public → ui}/assets/alibaba-TTwafVwX.svg +0 -0
- /package/.output/{public → ui}/assets/minimax-BPMzvuL-.jpeg +0 -0
- /package/.output/{public → ui}/assets/qwen-mMn3f5ul.webp +0 -0
- /package/.output/{public → ui}/assets/zhipuai-BPNAnxo-.svg +0 -0
- /package/src/{routes → backend/routes}/livez.ts +0 -0
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
import { u as unreachable } from "./devlop.mjs";
|
|
2
|
-
import { r as reactExports, j as jsxRuntimeExports } from "./react.mjs";
|
|
3
|
-
import { u as unified } from "./unified.mjs";
|
|
4
|
-
import { r as remarkParse } from "./remark-parse.mjs";
|
|
5
|
-
import { r as remarkRehype } from "./remark-rehype.mjs";
|
|
6
|
-
import { V as VFile } from "./vfile.mjs";
|
|
7
|
-
import { v as visit } from "./unist-util-visit.mjs";
|
|
8
|
-
import { t as toJsxRuntime } from "./hast-util-to-jsx-runtime.mjs";
|
|
9
|
-
import { u as urlAttributes } from "./html-url-attributes.mjs";
|
|
10
|
-
import "./bail.mjs";
|
|
11
|
-
import "./extend.mjs";
|
|
12
|
-
import "./is-plain-obj.mjs";
|
|
13
|
-
import "./trough.mjs";
|
|
14
|
-
import "./mdast-util-from-markdown.mjs";
|
|
15
|
-
import "./micromark-util-decode-numeric-character-reference+[...].mjs";
|
|
16
|
-
import "./micromark-util-decode-string.mjs";
|
|
17
|
-
import "./decode-named-character-reference+[...].mjs";
|
|
18
|
-
import "./character-entities.mjs";
|
|
19
|
-
import "./micromark-util-normalize-identifier+[...].mjs";
|
|
20
|
-
import "./micromark.mjs";
|
|
21
|
-
import "./micromark-util-combine-extensions+[...].mjs";
|
|
22
|
-
import "./micromark-util-chunked.mjs";
|
|
23
|
-
import "./micromark-factory-space.mjs";
|
|
24
|
-
import "./micromark-util-character.mjs";
|
|
25
|
-
import "./micromark-core-commonmark.mjs";
|
|
26
|
-
import "./micromark-util-classify-character+[...].mjs";
|
|
27
|
-
import "./micromark-util-resolve-all.mjs";
|
|
28
|
-
import "./micromark-util-subtokenize.mjs";
|
|
29
|
-
import "./micromark-factory-destination.mjs";
|
|
30
|
-
import "./micromark-factory-label.mjs";
|
|
31
|
-
import "./micromark-factory-title.mjs";
|
|
32
|
-
import "./micromark-factory-whitespace.mjs";
|
|
33
|
-
import "./micromark-util-html-tag-name.mjs";
|
|
34
|
-
import "./unist-util-stringify-position.mjs";
|
|
35
|
-
import "./mdast-util-to-string.mjs";
|
|
36
|
-
import "./mdast-util-to-hast.mjs";
|
|
37
|
-
import "./ungap__structured-clone.mjs";
|
|
38
|
-
import "./micromark-util-sanitize-uri.mjs";
|
|
39
|
-
import "./unist-util-position.mjs";
|
|
40
|
-
import "./trim-lines.mjs";
|
|
41
|
-
import "node:path";
|
|
42
|
-
import "node:url";
|
|
43
|
-
import "./vfile-message.mjs";
|
|
44
|
-
import "node:process";
|
|
45
|
-
import "./unist-util-visit-parents.mjs";
|
|
46
|
-
import "./unist-util-is.mjs";
|
|
47
|
-
import "./comma-separated-tokens.mjs";
|
|
48
|
-
import "./property-information.mjs";
|
|
49
|
-
import "./space-separated-tokens.mjs";
|
|
50
|
-
import "./style-to-js.mjs";
|
|
51
|
-
import "./style-to-object.mjs";
|
|
52
|
-
import "./inline-style-parser.mjs";
|
|
53
|
-
import "./hast-util-whitespace.mjs";
|
|
54
|
-
import "./estree-util-is-identifier-name.mjs";
|
|
55
|
-
const changelog = "https://github.com/remarkjs/react-markdown/blob/main/changelog.md";
|
|
56
|
-
const emptyPlugins = [];
|
|
57
|
-
const emptyRemarkRehypeOptions = { allowDangerousHtml: true };
|
|
58
|
-
const safeProtocol = /^(https?|ircs?|mailto|xmpp)$/i;
|
|
59
|
-
const deprecations = [
|
|
60
|
-
{ from: "astPlugins", id: "remove-buggy-html-in-markdown-parser" },
|
|
61
|
-
{ from: "allowDangerousHtml", id: "remove-buggy-html-in-markdown-parser" },
|
|
62
|
-
{
|
|
63
|
-
from: "allowNode",
|
|
64
|
-
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
65
|
-
to: "allowElement"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
from: "allowedTypes",
|
|
69
|
-
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
70
|
-
to: "allowedElements"
|
|
71
|
-
},
|
|
72
|
-
{ from: "className", id: "remove-classname" },
|
|
73
|
-
{
|
|
74
|
-
from: "disallowedTypes",
|
|
75
|
-
id: "replace-allownode-allowedtypes-and-disallowedtypes",
|
|
76
|
-
to: "disallowedElements"
|
|
77
|
-
},
|
|
78
|
-
{ from: "escapeHtml", id: "remove-buggy-html-in-markdown-parser" },
|
|
79
|
-
{ from: "includeElementIndex", id: "#remove-includeelementindex" },
|
|
80
|
-
{
|
|
81
|
-
from: "includeNodeIndex",
|
|
82
|
-
id: "change-includenodeindex-to-includeelementindex"
|
|
83
|
-
},
|
|
84
|
-
{ from: "linkTarget", id: "remove-linktarget" },
|
|
85
|
-
{ from: "plugins", id: "change-plugins-to-remarkplugins", to: "remarkPlugins" },
|
|
86
|
-
{ from: "rawSourcePos", id: "#remove-rawsourcepos" },
|
|
87
|
-
{ from: "renderers", id: "change-renderers-to-components", to: "components" },
|
|
88
|
-
{ from: "source", id: "change-source-to-children", to: "children" },
|
|
89
|
-
{ from: "sourcePos", id: "#remove-sourcepos" },
|
|
90
|
-
{ from: "transformImageUri", id: "#add-urltransform", to: "urlTransform" },
|
|
91
|
-
{ from: "transformLinkUri", id: "#add-urltransform", to: "urlTransform" }
|
|
92
|
-
];
|
|
93
|
-
function Markdown(options) {
|
|
94
|
-
const processor = createProcessor(options);
|
|
95
|
-
const file = createFile(options);
|
|
96
|
-
return post(processor.runSync(processor.parse(file), file), options);
|
|
97
|
-
}
|
|
98
|
-
async function MarkdownAsync(options) {
|
|
99
|
-
const processor = createProcessor(options);
|
|
100
|
-
const file = createFile(options);
|
|
101
|
-
const tree = await processor.run(processor.parse(file), file);
|
|
102
|
-
return post(tree, options);
|
|
103
|
-
}
|
|
104
|
-
function MarkdownHooks(options) {
|
|
105
|
-
const processor = createProcessor(options);
|
|
106
|
-
const [error, setError] = reactExports.useState(
|
|
107
|
-
/** @type {Error | undefined} */
|
|
108
|
-
void 0
|
|
109
|
-
);
|
|
110
|
-
const [tree, setTree] = reactExports.useState(
|
|
111
|
-
/** @type {Root | undefined} */
|
|
112
|
-
void 0
|
|
113
|
-
);
|
|
114
|
-
reactExports.useEffect(
|
|
115
|
-
function() {
|
|
116
|
-
let cancelled = false;
|
|
117
|
-
const file = createFile(options);
|
|
118
|
-
processor.run(processor.parse(file), file, function(error2, tree2) {
|
|
119
|
-
if (!cancelled) {
|
|
120
|
-
setError(error2);
|
|
121
|
-
setTree(tree2);
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
return function() {
|
|
125
|
-
cancelled = true;
|
|
126
|
-
};
|
|
127
|
-
},
|
|
128
|
-
[
|
|
129
|
-
options.children,
|
|
130
|
-
options.rehypePlugins,
|
|
131
|
-
options.remarkPlugins,
|
|
132
|
-
options.remarkRehypeOptions
|
|
133
|
-
]
|
|
134
|
-
);
|
|
135
|
-
if (error) throw error;
|
|
136
|
-
return tree ? post(tree, options) : options.fallback;
|
|
137
|
-
}
|
|
138
|
-
function createProcessor(options) {
|
|
139
|
-
const rehypePlugins = options.rehypePlugins || emptyPlugins;
|
|
140
|
-
const remarkPlugins = options.remarkPlugins || emptyPlugins;
|
|
141
|
-
const remarkRehypeOptions = options.remarkRehypeOptions ? { ...options.remarkRehypeOptions, ...emptyRemarkRehypeOptions } : emptyRemarkRehypeOptions;
|
|
142
|
-
const processor = unified().use(remarkParse).use(remarkPlugins).use(remarkRehype, remarkRehypeOptions).use(rehypePlugins);
|
|
143
|
-
return processor;
|
|
144
|
-
}
|
|
145
|
-
function createFile(options) {
|
|
146
|
-
const children = options.children || "";
|
|
147
|
-
const file = new VFile();
|
|
148
|
-
if (typeof children === "string") {
|
|
149
|
-
file.value = children;
|
|
150
|
-
}
|
|
151
|
-
return file;
|
|
152
|
-
}
|
|
153
|
-
function post(tree, options) {
|
|
154
|
-
const allowedElements = options.allowedElements;
|
|
155
|
-
const allowElement = options.allowElement;
|
|
156
|
-
const components = options.components;
|
|
157
|
-
const disallowedElements = options.disallowedElements;
|
|
158
|
-
const skipHtml = options.skipHtml;
|
|
159
|
-
const unwrapDisallowed = options.unwrapDisallowed;
|
|
160
|
-
const urlTransform = options.urlTransform || defaultUrlTransform;
|
|
161
|
-
for (const deprecation of deprecations) {
|
|
162
|
-
if (Object.hasOwn(options, deprecation.from)) {
|
|
163
|
-
unreachable(
|
|
164
|
-
"Unexpected `" + deprecation.from + "` prop, " + (deprecation.to ? "use `" + deprecation.to + "` instead" : "remove it") + " (see <" + changelog + "#" + deprecation.id + "> for more info)"
|
|
165
|
-
);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
visit(tree, transform);
|
|
169
|
-
return toJsxRuntime(tree, {
|
|
170
|
-
Fragment: jsxRuntimeExports.Fragment,
|
|
171
|
-
components,
|
|
172
|
-
ignoreInvalidStyle: true,
|
|
173
|
-
jsx: jsxRuntimeExports.jsx,
|
|
174
|
-
jsxs: jsxRuntimeExports.jsxs,
|
|
175
|
-
passKeys: true,
|
|
176
|
-
passNode: true
|
|
177
|
-
});
|
|
178
|
-
function transform(node, index, parent) {
|
|
179
|
-
if (node.type === "raw" && parent && typeof index === "number") {
|
|
180
|
-
if (skipHtml) {
|
|
181
|
-
parent.children.splice(index, 1);
|
|
182
|
-
} else {
|
|
183
|
-
parent.children[index] = { type: "text", value: node.value };
|
|
184
|
-
}
|
|
185
|
-
return index;
|
|
186
|
-
}
|
|
187
|
-
if (node.type === "element") {
|
|
188
|
-
let key;
|
|
189
|
-
for (key in urlAttributes) {
|
|
190
|
-
if (Object.hasOwn(urlAttributes, key) && Object.hasOwn(node.properties, key)) {
|
|
191
|
-
const value = node.properties[key];
|
|
192
|
-
const test = urlAttributes[key];
|
|
193
|
-
if (test === null || test.includes(node.tagName)) {
|
|
194
|
-
node.properties[key] = urlTransform(String(value || ""), key, node);
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
if (node.type === "element") {
|
|
200
|
-
let remove = allowedElements ? !allowedElements.includes(node.tagName) : disallowedElements ? disallowedElements.includes(node.tagName) : false;
|
|
201
|
-
if (!remove && allowElement && typeof index === "number") {
|
|
202
|
-
remove = !allowElement(node, index, parent);
|
|
203
|
-
}
|
|
204
|
-
if (remove && parent && typeof index === "number") {
|
|
205
|
-
if (unwrapDisallowed && node.children) {
|
|
206
|
-
parent.children.splice(index, 1, ...node.children);
|
|
207
|
-
} else {
|
|
208
|
-
parent.children.splice(index, 1);
|
|
209
|
-
}
|
|
210
|
-
return index;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
function defaultUrlTransform(value) {
|
|
216
|
-
const colon = value.indexOf(":");
|
|
217
|
-
const questionMark = value.indexOf("?");
|
|
218
|
-
const numberSign = value.indexOf("#");
|
|
219
|
-
const slash = value.indexOf("/");
|
|
220
|
-
if (
|
|
221
|
-
// If there is no protocol, it’s relative.
|
|
222
|
-
colon === -1 || // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
|
|
223
|
-
slash !== -1 && colon > slash || questionMark !== -1 && colon > questionMark || numberSign !== -1 && colon > numberSign || // It is a protocol, it should be allowed.
|
|
224
|
-
safeProtocol.test(value.slice(0, colon))
|
|
225
|
-
) {
|
|
226
|
-
return value;
|
|
227
|
-
}
|
|
228
|
-
return "";
|
|
229
|
-
}
|
|
230
|
-
export {
|
|
231
|
-
MarkdownAsync,
|
|
232
|
-
MarkdownHooks,
|
|
233
|
-
Markdown as default,
|
|
234
|
-
defaultUrlTransform
|
|
235
|
-
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { r as reactExports } from "./react.mjs";
|
|
2
|
-
import { s as styleSingleton } from "./react-style-singleton.mjs";
|
|
3
|
-
var zeroRightClassName = "right-scroll-bar-position";
|
|
4
|
-
var fullWidthClassName = "width-before-scroll-bar";
|
|
5
|
-
var noScrollbarsClassName = "with-scroll-bars-hidden";
|
|
6
|
-
var removedBarSizeVariable = "--removed-body-scroll-bar-size";
|
|
7
|
-
var zeroGap = {
|
|
8
|
-
left: 0,
|
|
9
|
-
top: 0,
|
|
10
|
-
right: 0,
|
|
11
|
-
gap: 0
|
|
12
|
-
};
|
|
13
|
-
var parse = function(x) {
|
|
14
|
-
return parseInt(x || "", 10) || 0;
|
|
15
|
-
};
|
|
16
|
-
var getOffset = function(gapMode) {
|
|
17
|
-
var cs = window.getComputedStyle(document.body);
|
|
18
|
-
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
19
|
-
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
20
|
-
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
21
|
-
return [parse(left), parse(top), parse(right)];
|
|
22
|
-
};
|
|
23
|
-
var getGapWidth = function(gapMode) {
|
|
24
|
-
if (gapMode === void 0) {
|
|
25
|
-
gapMode = "margin";
|
|
26
|
-
}
|
|
27
|
-
if (typeof window === "undefined") {
|
|
28
|
-
return zeroGap;
|
|
29
|
-
}
|
|
30
|
-
var offsets = getOffset(gapMode);
|
|
31
|
-
var documentWidth = document.documentElement.clientWidth;
|
|
32
|
-
var windowWidth = window.innerWidth;
|
|
33
|
-
return {
|
|
34
|
-
left: offsets[0],
|
|
35
|
-
top: offsets[1],
|
|
36
|
-
right: offsets[2],
|
|
37
|
-
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
var Style = styleSingleton();
|
|
41
|
-
var lockAttribute = "data-scroll-locked";
|
|
42
|
-
var getStyles = function(_a, allowRelative, gapMode, important) {
|
|
43
|
-
var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;
|
|
44
|
-
if (gapMode === void 0) {
|
|
45
|
-
gapMode = "margin";
|
|
46
|
-
}
|
|
47
|
-
return "\n .".concat(noScrollbarsClassName, " {\n overflow: hidden ").concat(important, ";\n padding-right: ").concat(gap, "px ").concat(important, ";\n }\n body[").concat(lockAttribute, "] {\n overflow: hidden ").concat(important, ";\n overscroll-behavior: contain;\n ").concat([
|
|
48
|
-
allowRelative && "position: relative ".concat(important, ";"),
|
|
49
|
-
gapMode === "margin" && "\n padding-left: ".concat(left, "px;\n padding-top: ").concat(top, "px;\n padding-right: ").concat(right, "px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(gap, "px ").concat(important, ";\n "),
|
|
50
|
-
gapMode === "padding" && "padding-right: ".concat(gap, "px ").concat(important, ";")
|
|
51
|
-
].filter(Boolean).join(""), "\n }\n \n .").concat(zeroRightClassName, " {\n right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " {\n margin-right: ").concat(gap, "px ").concat(important, ";\n }\n \n .").concat(zeroRightClassName, " .").concat(zeroRightClassName, " {\n right: 0 ").concat(important, ";\n }\n \n .").concat(fullWidthClassName, " .").concat(fullWidthClassName, " {\n margin-right: 0 ").concat(important, ";\n }\n \n body[").concat(lockAttribute, "] {\n ").concat(removedBarSizeVariable, ": ").concat(gap, "px;\n }\n");
|
|
52
|
-
};
|
|
53
|
-
var getCurrentUseCounter = function() {
|
|
54
|
-
var counter = parseInt(document.body.getAttribute(lockAttribute) || "0", 10);
|
|
55
|
-
return isFinite(counter) ? counter : 0;
|
|
56
|
-
};
|
|
57
|
-
var useLockAttribute = function() {
|
|
58
|
-
reactExports.useEffect(function() {
|
|
59
|
-
document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());
|
|
60
|
-
return function() {
|
|
61
|
-
var newCounter = getCurrentUseCounter() - 1;
|
|
62
|
-
if (newCounter <= 0) {
|
|
63
|
-
document.body.removeAttribute(lockAttribute);
|
|
64
|
-
} else {
|
|
65
|
-
document.body.setAttribute(lockAttribute, newCounter.toString());
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}, []);
|
|
69
|
-
};
|
|
70
|
-
var RemoveScrollBar = function(_a) {
|
|
71
|
-
var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? "margin" : _b;
|
|
72
|
-
useLockAttribute();
|
|
73
|
-
var gap = reactExports.useMemo(function() {
|
|
74
|
-
return getGapWidth(gapMode);
|
|
75
|
-
}, [gapMode]);
|
|
76
|
-
return reactExports.createElement(Style, { styles: getStyles(gap, !noRelative, gapMode, !noImportant ? "!important" : "") });
|
|
77
|
-
};
|
|
78
|
-
export {
|
|
79
|
-
RemoveScrollBar as R,
|
|
80
|
-
fullWidthClassName as f,
|
|
81
|
-
zeroRightClassName as z
|
|
82
|
-
};
|
|
@@ -1,328 +0,0 @@
|
|
|
1
|
-
import { __rest, __assign, __spreadArray } from "tslib";
|
|
2
|
-
import { r as reactExports } from "./react.mjs";
|
|
3
|
-
import { z as zeroRightClassName, f as fullWidthClassName, R as RemoveScrollBar } from "./react-remove-scroll-bar.mjs";
|
|
4
|
-
import { c as createSidecarMedium, e as exportSidecar } from "./use-sidecar.mjs";
|
|
5
|
-
import { u as useMergeRefs } from "./use-callback-ref.mjs";
|
|
6
|
-
import { s as styleSingleton } from "./react-style-singleton.mjs";
|
|
7
|
-
var effectCar = createSidecarMedium();
|
|
8
|
-
var nothing = function() {
|
|
9
|
-
return;
|
|
10
|
-
};
|
|
11
|
-
var RemoveScroll = reactExports.forwardRef(function(props, parentRef) {
|
|
12
|
-
var ref = reactExports.useRef(null);
|
|
13
|
-
var _a = reactExports.useState({
|
|
14
|
-
onScrollCapture: nothing,
|
|
15
|
-
onWheelCapture: nothing,
|
|
16
|
-
onTouchMoveCapture: nothing
|
|
17
|
-
}), callbacks = _a[0], setCallbacks = _a[1];
|
|
18
|
-
var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noRelative = props.noRelative, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? "div" : _b, gapMode = props.gapMode, rest = __rest(props, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]);
|
|
19
|
-
var SideCar2 = sideCar;
|
|
20
|
-
var containerRef = useMergeRefs([ref, parentRef]);
|
|
21
|
-
var containerProps = __assign(__assign({}, rest), callbacks);
|
|
22
|
-
return reactExports.createElement(
|
|
23
|
-
reactExports.Fragment,
|
|
24
|
-
null,
|
|
25
|
-
enabled && reactExports.createElement(SideCar2, { sideCar: effectCar, removeScrollBar, shards, noRelative, noIsolation, inert, setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode }),
|
|
26
|
-
forwardProps ? reactExports.cloneElement(reactExports.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef })) : reactExports.createElement(Container, __assign({}, containerProps, { className, ref: containerRef }), children)
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
|
-
RemoveScroll.defaultProps = {
|
|
30
|
-
enabled: true,
|
|
31
|
-
removeScrollBar: true,
|
|
32
|
-
inert: false
|
|
33
|
-
};
|
|
34
|
-
RemoveScroll.classNames = {
|
|
35
|
-
fullWidth: fullWidthClassName,
|
|
36
|
-
zeroRight: zeroRightClassName
|
|
37
|
-
};
|
|
38
|
-
var passiveSupported = false;
|
|
39
|
-
if (typeof window !== "undefined") {
|
|
40
|
-
try {
|
|
41
|
-
var options = Object.defineProperty({}, "passive", {
|
|
42
|
-
get: function() {
|
|
43
|
-
passiveSupported = true;
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
window.addEventListener("test", options, options);
|
|
48
|
-
window.removeEventListener("test", options, options);
|
|
49
|
-
} catch (err) {
|
|
50
|
-
passiveSupported = false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
54
|
-
var alwaysContainsScroll = function(node) {
|
|
55
|
-
return node.tagName === "TEXTAREA";
|
|
56
|
-
};
|
|
57
|
-
var elementCanBeScrolled = function(node, overflow) {
|
|
58
|
-
if (!(node instanceof Element)) {
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
var styles = window.getComputedStyle(node);
|
|
62
|
-
return (
|
|
63
|
-
// not-not-scrollable
|
|
64
|
-
styles[overflow] !== "hidden" && // contains scroll inside self
|
|
65
|
-
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
|
|
66
|
-
);
|
|
67
|
-
};
|
|
68
|
-
var elementCouldBeVScrolled = function(node) {
|
|
69
|
-
return elementCanBeScrolled(node, "overflowY");
|
|
70
|
-
};
|
|
71
|
-
var elementCouldBeHScrolled = function(node) {
|
|
72
|
-
return elementCanBeScrolled(node, "overflowX");
|
|
73
|
-
};
|
|
74
|
-
var locationCouldBeScrolled = function(axis, node) {
|
|
75
|
-
var ownerDocument = node.ownerDocument;
|
|
76
|
-
var current = node;
|
|
77
|
-
do {
|
|
78
|
-
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
|
|
79
|
-
current = current.host;
|
|
80
|
-
}
|
|
81
|
-
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
82
|
-
if (isScrollable) {
|
|
83
|
-
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
84
|
-
if (scrollHeight > clientHeight) {
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
current = current.parentNode;
|
|
89
|
-
} while (current && current !== ownerDocument.body);
|
|
90
|
-
return false;
|
|
91
|
-
};
|
|
92
|
-
var getVScrollVariables = function(_a) {
|
|
93
|
-
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
94
|
-
return [
|
|
95
|
-
scrollTop,
|
|
96
|
-
scrollHeight,
|
|
97
|
-
clientHeight
|
|
98
|
-
];
|
|
99
|
-
};
|
|
100
|
-
var getHScrollVariables = function(_a) {
|
|
101
|
-
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
102
|
-
return [
|
|
103
|
-
scrollLeft,
|
|
104
|
-
scrollWidth,
|
|
105
|
-
clientWidth
|
|
106
|
-
];
|
|
107
|
-
};
|
|
108
|
-
var elementCouldBeScrolled = function(axis, node) {
|
|
109
|
-
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
110
|
-
};
|
|
111
|
-
var getScrollVariables = function(axis, node) {
|
|
112
|
-
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
113
|
-
};
|
|
114
|
-
var getDirectionFactor = function(axis, direction) {
|
|
115
|
-
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
116
|
-
};
|
|
117
|
-
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
118
|
-
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
119
|
-
var delta = directionFactor * sourceDelta;
|
|
120
|
-
var target = event.target;
|
|
121
|
-
var targetInLock = endTarget.contains(target);
|
|
122
|
-
var shouldCancelScroll = false;
|
|
123
|
-
var isDeltaPositive = delta > 0;
|
|
124
|
-
var availableScroll = 0;
|
|
125
|
-
var availableScrollTop = 0;
|
|
126
|
-
do {
|
|
127
|
-
if (!target) {
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
131
|
-
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
132
|
-
if (position || elementScroll) {
|
|
133
|
-
if (elementCouldBeScrolled(axis, target)) {
|
|
134
|
-
availableScroll += elementScroll;
|
|
135
|
-
availableScrollTop += position;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
var parent_1 = target.parentNode;
|
|
139
|
-
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
140
|
-
} while (
|
|
141
|
-
// portaled content
|
|
142
|
-
!targetInLock && target !== document.body || // self content
|
|
143
|
-
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
144
|
-
);
|
|
145
|
-
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
|
|
146
|
-
shouldCancelScroll = true;
|
|
147
|
-
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
|
|
148
|
-
shouldCancelScroll = true;
|
|
149
|
-
}
|
|
150
|
-
return shouldCancelScroll;
|
|
151
|
-
};
|
|
152
|
-
var getTouchXY = function(event) {
|
|
153
|
-
return "changedTouches" in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
|
|
154
|
-
};
|
|
155
|
-
var getDeltaXY = function(event) {
|
|
156
|
-
return [event.deltaX, event.deltaY];
|
|
157
|
-
};
|
|
158
|
-
var extractRef = function(ref) {
|
|
159
|
-
return ref && "current" in ref ? ref.current : ref;
|
|
160
|
-
};
|
|
161
|
-
var deltaCompare = function(x, y) {
|
|
162
|
-
return x[0] === y[0] && x[1] === y[1];
|
|
163
|
-
};
|
|
164
|
-
var generateStyle = function(id) {
|
|
165
|
-
return "\n .block-interactivity-".concat(id, " {pointer-events: none;}\n .allow-interactivity-").concat(id, " {pointer-events: all;}\n");
|
|
166
|
-
};
|
|
167
|
-
var idCounter = 0;
|
|
168
|
-
var lockStack = [];
|
|
169
|
-
function RemoveScrollSideCar(props) {
|
|
170
|
-
var shouldPreventQueue = reactExports.useRef([]);
|
|
171
|
-
var touchStartRef = reactExports.useRef([0, 0]);
|
|
172
|
-
var activeAxis = reactExports.useRef();
|
|
173
|
-
var id = reactExports.useState(idCounter++)[0];
|
|
174
|
-
var Style = reactExports.useState(styleSingleton)[0];
|
|
175
|
-
var lastProps = reactExports.useRef(props);
|
|
176
|
-
reactExports.useEffect(function() {
|
|
177
|
-
lastProps.current = props;
|
|
178
|
-
}, [props]);
|
|
179
|
-
reactExports.useEffect(function() {
|
|
180
|
-
if (props.inert) {
|
|
181
|
-
document.body.classList.add("block-interactivity-".concat(id));
|
|
182
|
-
var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);
|
|
183
|
-
allow_1.forEach(function(el) {
|
|
184
|
-
return el.classList.add("allow-interactivity-".concat(id));
|
|
185
|
-
});
|
|
186
|
-
return function() {
|
|
187
|
-
document.body.classList.remove("block-interactivity-".concat(id));
|
|
188
|
-
allow_1.forEach(function(el) {
|
|
189
|
-
return el.classList.remove("allow-interactivity-".concat(id));
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
return;
|
|
194
|
-
}, [props.inert, props.lockRef.current, props.shards]);
|
|
195
|
-
var shouldCancelEvent = reactExports.useCallback(function(event, parent) {
|
|
196
|
-
if ("touches" in event && event.touches.length === 2 || event.type === "wheel" && event.ctrlKey) {
|
|
197
|
-
return !lastProps.current.allowPinchZoom;
|
|
198
|
-
}
|
|
199
|
-
var touch = getTouchXY(event);
|
|
200
|
-
var touchStart = touchStartRef.current;
|
|
201
|
-
var deltaX = "deltaX" in event ? event.deltaX : touchStart[0] - touch[0];
|
|
202
|
-
var deltaY = "deltaY" in event ? event.deltaY : touchStart[1] - touch[1];
|
|
203
|
-
var currentAxis;
|
|
204
|
-
var target = event.target;
|
|
205
|
-
var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? "h" : "v";
|
|
206
|
-
if ("touches" in event && moveDirection === "h" && target.type === "range") {
|
|
207
|
-
return false;
|
|
208
|
-
}
|
|
209
|
-
var selection = window.getSelection();
|
|
210
|
-
var anchorNode = selection && selection.anchorNode;
|
|
211
|
-
var isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
|
|
212
|
-
if (isTouchingSelection) {
|
|
213
|
-
return false;
|
|
214
|
-
}
|
|
215
|
-
var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
216
|
-
if (!canBeScrolledInMainDirection) {
|
|
217
|
-
return true;
|
|
218
|
-
}
|
|
219
|
-
if (canBeScrolledInMainDirection) {
|
|
220
|
-
currentAxis = moveDirection;
|
|
221
|
-
} else {
|
|
222
|
-
currentAxis = moveDirection === "v" ? "h" : "v";
|
|
223
|
-
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
|
|
224
|
-
}
|
|
225
|
-
if (!canBeScrolledInMainDirection) {
|
|
226
|
-
return false;
|
|
227
|
-
}
|
|
228
|
-
if (!activeAxis.current && "changedTouches" in event && (deltaX || deltaY)) {
|
|
229
|
-
activeAxis.current = currentAxis;
|
|
230
|
-
}
|
|
231
|
-
if (!currentAxis) {
|
|
232
|
-
return true;
|
|
233
|
-
}
|
|
234
|
-
var cancelingAxis = activeAxis.current || currentAxis;
|
|
235
|
-
return handleScroll(cancelingAxis, parent, event, cancelingAxis === "h" ? deltaX : deltaY);
|
|
236
|
-
}, []);
|
|
237
|
-
var shouldPrevent = reactExports.useCallback(function(_event) {
|
|
238
|
-
var event = _event;
|
|
239
|
-
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
|
|
240
|
-
return;
|
|
241
|
-
}
|
|
242
|
-
var delta = "deltaY" in event ? getDeltaXY(event) : getTouchXY(event);
|
|
243
|
-
var sourceEvent = shouldPreventQueue.current.filter(function(e) {
|
|
244
|
-
return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta);
|
|
245
|
-
})[0];
|
|
246
|
-
if (sourceEvent && sourceEvent.should) {
|
|
247
|
-
if (event.cancelable) {
|
|
248
|
-
event.preventDefault();
|
|
249
|
-
}
|
|
250
|
-
return;
|
|
251
|
-
}
|
|
252
|
-
if (!sourceEvent) {
|
|
253
|
-
var shardNodes = (lastProps.current.shards || []).map(extractRef).filter(Boolean).filter(function(node) {
|
|
254
|
-
return node.contains(event.target);
|
|
255
|
-
});
|
|
256
|
-
var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
|
|
257
|
-
if (shouldStop) {
|
|
258
|
-
if (event.cancelable) {
|
|
259
|
-
event.preventDefault();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
}, []);
|
|
264
|
-
var shouldCancel = reactExports.useCallback(function(name, delta, target, should) {
|
|
265
|
-
var event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
|
|
266
|
-
shouldPreventQueue.current.push(event);
|
|
267
|
-
setTimeout(function() {
|
|
268
|
-
shouldPreventQueue.current = shouldPreventQueue.current.filter(function(e) {
|
|
269
|
-
return e !== event;
|
|
270
|
-
});
|
|
271
|
-
}, 1);
|
|
272
|
-
}, []);
|
|
273
|
-
var scrollTouchStart = reactExports.useCallback(function(event) {
|
|
274
|
-
touchStartRef.current = getTouchXY(event);
|
|
275
|
-
activeAxis.current = void 0;
|
|
276
|
-
}, []);
|
|
277
|
-
var scrollWheel = reactExports.useCallback(function(event) {
|
|
278
|
-
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
279
|
-
}, []);
|
|
280
|
-
var scrollTouchMove = reactExports.useCallback(function(event) {
|
|
281
|
-
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
|
|
282
|
-
}, []);
|
|
283
|
-
reactExports.useEffect(function() {
|
|
284
|
-
lockStack.push(Style);
|
|
285
|
-
props.setCallbacks({
|
|
286
|
-
onScrollCapture: scrollWheel,
|
|
287
|
-
onWheelCapture: scrollWheel,
|
|
288
|
-
onTouchMoveCapture: scrollTouchMove
|
|
289
|
-
});
|
|
290
|
-
document.addEventListener("wheel", shouldPrevent, nonPassive);
|
|
291
|
-
document.addEventListener("touchmove", shouldPrevent, nonPassive);
|
|
292
|
-
document.addEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
293
|
-
return function() {
|
|
294
|
-
lockStack = lockStack.filter(function(inst) {
|
|
295
|
-
return inst !== Style;
|
|
296
|
-
});
|
|
297
|
-
document.removeEventListener("wheel", shouldPrevent, nonPassive);
|
|
298
|
-
document.removeEventListener("touchmove", shouldPrevent, nonPassive);
|
|
299
|
-
document.removeEventListener("touchstart", scrollTouchStart, nonPassive);
|
|
300
|
-
};
|
|
301
|
-
}, []);
|
|
302
|
-
var removeScrollBar = props.removeScrollBar, inert = props.inert;
|
|
303
|
-
return reactExports.createElement(
|
|
304
|
-
reactExports.Fragment,
|
|
305
|
-
null,
|
|
306
|
-
inert ? reactExports.createElement(Style, { styles: generateStyle(id) }) : null,
|
|
307
|
-
removeScrollBar ? reactExports.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null
|
|
308
|
-
);
|
|
309
|
-
}
|
|
310
|
-
function getOutermostShadowParent(node) {
|
|
311
|
-
var shadowParent = null;
|
|
312
|
-
while (node !== null) {
|
|
313
|
-
if (node instanceof ShadowRoot) {
|
|
314
|
-
shadowParent = node.host;
|
|
315
|
-
node = node.host;
|
|
316
|
-
}
|
|
317
|
-
node = node.parentNode;
|
|
318
|
-
}
|
|
319
|
-
return shadowParent;
|
|
320
|
-
}
|
|
321
|
-
const SideCar = exportSidecar(effectCar, RemoveScrollSideCar);
|
|
322
|
-
var ReactRemoveScroll = reactExports.forwardRef(function(props, ref) {
|
|
323
|
-
return reactExports.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: SideCar }));
|
|
324
|
-
});
|
|
325
|
-
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
326
|
-
export {
|
|
327
|
-
ReactRemoveScroll as R
|
|
328
|
-
};
|