@socketsecurity/cli-with-sentry 0.15.10 → 0.15.12
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/bin/cli.js +6 -6
- package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/cli.js +5731 -6607
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +274 -305
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +28 -34
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/shadow-bin.js +96 -123
- package/dist/shadow-bin.js.map +1 -1
- package/dist/shadow-inject.js +470 -580
- package/dist/shadow-inject.js.map +1 -1
- package/dist/socket-completion.bash +221 -0
- package/dist/types/cli.d.mts +2 -2
- package/dist/types/commands/analytics/cmd-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -6
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -7
- package/dist/types/commands/analytics/handle-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -1
- package/dist/types/commands/analytics/output-analytics.d.mts +26 -46
- package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -16
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -47
- package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +9 -15
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/ci/cmd-ci.d.mts +9 -15
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +3 -3
- package/dist/types/commands/ci/handle-ci.d.mts +2 -2
- package/dist/types/commands/config/cmd-config-auto.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-get.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-list.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-set.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-unset.d.mts +9 -15
- package/dist/types/commands/config/cmd-config.d.mts +3 -3
- package/dist/types/commands/config/discover-config-value.d.mts +3 -5
- package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-auto.d.mts +7 -10
- package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-get.d.mts +7 -10
- package/dist/types/commands/config/handle-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-set.d.mts +8 -12
- package/dist/types/commands/config/handle-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-unset.d.mts +7 -10
- package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-auto.d.mts +4 -8
- package/dist/types/commands/config/output-config-get.d.mts +4 -8
- package/dist/types/commands/config/output-config-list.d.mts +6 -9
- package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-set.d.mts +3 -6
- package/dist/types/commands/config/output-config-unset.d.mts +3 -6
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts +9 -15
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -10
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -11
- package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -15
- package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +9 -15
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -3
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts +9 -15
- package/dist/types/commands/fix/git.d.mts +14 -49
- package/dist/types/commands/fix/npm-fix.d.mts +4 -16
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/open-pr.d.mts +20 -46
- package/dist/types/commands/fix/open-pr.d.mts.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts +4 -16
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/run-fix.d.mts +3 -3
- package/dist/types/commands/fix/shared.d.mts +9 -15
- package/dist/types/commands/fix/types.d.mts +16 -16
- package/dist/types/commands/info/cmd-info.d.mts +9 -15
- package/dist/types/commands/info/fetch-package-info.d.mts +3 -7
- package/dist/types/commands/info/handle-package-info.d.mts +15 -22
- package/dist/types/commands/info/handle-package-info.d.mts.map +1 -1
- package/dist/types/commands/info/output-package-info.d.mts +10 -18
- package/dist/types/commands/info/output-package-info.d.mts.map +1 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/cmd-install.d.mts +3 -0
- package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
- package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
- package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/output-install-completion.d.mts +12 -0
- package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/login/apply-login.d.mts +2 -7
- package/dist/types/commands/login/attempt-login.d.mts +2 -5
- package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
- package/dist/types/commands/login/cmd-login.d.mts +9 -15
- package/dist/types/commands/logout/apply-logout.d.mts +2 -2
- package/dist/types/commands/logout/attempt-logout.d.mts +2 -2
- package/dist/types/commands/logout/cmd-logout.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +7 -15
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts +3 -9
- package/dist/types/commands/manifest/output-requirements.d.mts +6 -10
- package/dist/types/commands/{cdxgen → manifest}/run-cdxgen.d.mts +2 -2
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/npm/cmd-npm.d.mts +9 -15
- package/dist/types/commands/npx/cmd-npx.d.mts +9 -15
- package/dist/types/commands/oops/cmd-oops.d.mts +9 -15
- package/dist/types/commands/optimize/add-overrides.d.mts +18 -22
- package/dist/types/commands/optimize/apply-optimization.d.mts +2 -6
- package/dist/types/commands/optimize/cmd-optimize.d.mts +9 -15
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -7
- package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -5
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +8 -11
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -10
- package/dist/types/commands/optimize/ls-by-agent.d.mts +6 -13
- package/dist/types/commands/optimize/shared.d.mts +2 -2
- package/dist/types/commands/optimize/types.d.mts +7 -7
- package/dist/types/commands/optimize/update-lockfile.d.mts +9 -12
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -11
- package/dist/types/commands/organization/cmd-organization-list.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -3
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization.d.mts +3 -3
- package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -6
- package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -6
- package/dist/types/commands/organization/fetch-quota.d.mts +4 -6
- package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -6
- package/dist/types/commands/organization/handle-license-policy.d.mts +3 -6
- package/dist/types/commands/organization/handle-organization-list.d.mts +3 -5
- package/dist/types/commands/organization/handle-quota.d.mts +3 -3
- package/dist/types/commands/organization/handle-security-policy.d.mts +3 -6
- package/dist/types/commands/organization/output-license-policy.d.mts +4 -7
- package/dist/types/commands/organization/output-organization-list.d.mts +4 -7
- package/dist/types/commands/organization/output-quota.d.mts +4 -7
- package/dist/types/commands/organization/output-security-policy.d.mts +4 -7
- package/dist/types/commands/package/cmd-package-score.d.mts +9 -15
- package/dist/types/commands/package/cmd-package-shallow.d.mts +16 -22
- package/dist/types/commands/package/cmd-package.d.mts +3 -3
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts +49 -51
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -6
- package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -6
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -9
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -1
- package/dist/types/commands/package/output-purl-score.d.mts +4 -8
- package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -8
- package/dist/types/commands/package/parse-package-specifiers.d.mts +5 -8
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +9 -15
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -4
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +9 -15
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -4
- package/dist/types/commands/report/cmd-report-create.d.mts +9 -15
- package/dist/types/commands/report/cmd-report-view.d.mts +9 -15
- package/dist/types/commands/report/cmd-report.d.mts +3 -3
- package/dist/types/commands/repos/cmd-repos-create.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-del.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-list.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-update.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-view.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos.d.mts +3 -3
- package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -7
- package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -16
- package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -7
- package/dist/types/commands/repos/handle-create-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -7
- package/dist/types/commands/repos/handle-list-repos.d.mts +10 -17
- package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-update-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-view-repo.d.mts +3 -7
- package/dist/types/commands/repos/output-create-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-delete-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-list-repos.d.mts +4 -7
- package/dist/types/commands/repos/output-update-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-view-repo.d.mts +4 -7
- package/dist/types/commands/scan/cmd-scan-create.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-del.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan.d.mts +3 -3
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -26
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -22
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-report-data.d.mts +8 -14
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -7
- package/dist/types/commands/scan/fetch-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -6
- package/dist/types/commands/scan/generate-report.d.mts +36 -50
- package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts +20 -37
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -7
- package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-list-scans.d.mts +13 -23
- package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -7
- package/dist/types/commands/scan/handle-scan-report.d.mts +12 -21
- package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-view.d.mts +3 -8
- package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -8
- package/dist/types/commands/scan/output-delete-scan.d.mts +4 -7
- package/dist/types/commands/scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-list-scans.d.mts +4 -7
- package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -8
- package/dist/types/commands/scan/output-scan-report.d.mts +20 -38
- package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-view.d.mts +4 -10
- package/dist/types/commands/scan/stream-scan.d.mts +2 -6
- package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -2
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +4 -4
- package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -4
- package/dist/types/commands/scan/suggest_target.d.mts +2 -2
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +9 -15
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -16
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -17
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -7
- package/dist/types/commands/threat-feed/types.d.mts +12 -12
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -2
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +9 -15
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -1
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -2
- package/dist/types/constants.d.mts +125 -135
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/flags.d.mts +14 -17
- package/dist/types/flags.d.mts.map +1 -1
- package/dist/types/instrument-with-sentry.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/index.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +19 -24
- package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts +43 -71
- package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts +3 -8
- package/dist/types/shadow/npm/arborist/lib/edge.d.mts +58 -71
- package/dist/types/shadow/npm/arborist/lib/node.d.mts +55 -91
- package/dist/types/shadow/npm/arborist/lib/override-set.d.mts +26 -32
- package/dist/types/shadow/npm/arborist-helpers.d.mts +33 -66
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
- package/dist/types/shadow/npm/bin.d.mts +2 -5
- package/dist/types/shadow/npm/inject.d.mts +2 -2
- package/dist/types/shadow/npm/install.d.mts +11 -16
- package/dist/types/shadow/npm/link.d.mts +2 -5
- package/dist/types/shadow/npm/paths.d.mts +7 -7
- package/dist/types/shadow/npm/proc-log/index.d.mts +3 -6
- package/dist/types/types.d.mts +15 -17
- package/dist/types/utils/agent.d.mts +11 -14
- package/dist/types/utils/alert/artifact.d.mts +32 -50
- package/dist/types/utils/alert/fix.d.mts +5 -5
- package/dist/types/utils/alert/severity.d.mts +12 -24
- package/dist/types/utils/alerts-map.d.mts +23 -36
- package/dist/types/utils/api.d.mts +11 -34
- package/dist/types/utils/check-input.d.mts +9 -12
- package/dist/types/utils/cmd.d.mts +4 -4
- package/dist/types/utils/color-or-markdown.d.mts +14 -23
- package/dist/types/utils/color-or-markdown.d.mts.map +1 -1
- package/dist/types/utils/completion.d.mts +11 -0
- package/dist/types/utils/completion.d.mts.map +1 -0
- package/dist/types/utils/config.d.mts +22 -31
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/determine-org-slug.d.mts +2 -7
- package/dist/types/utils/errors.d.mts +12 -21
- package/dist/types/utils/fail-msg-with-badge.d.mts +2 -5
- package/dist/types/utils/fs.d.mts +21 -52
- package/dist/types/utils/get-output-kind.d.mts +3 -6
- package/dist/types/utils/glob.d.mts +13 -24
- package/dist/types/utils/map-to-object.d.mts +4 -6
- package/dist/types/utils/markdown.d.mts +4 -15
- package/dist/types/utils/meow-with-subcommands.d.mts +34 -46
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/npm-paths.d.mts +7 -7
- package/dist/types/utils/npm-paths.d.mts.map +1 -1
- package/dist/types/utils/objects.d.mts +3 -8
- package/dist/types/utils/output-formatting.d.mts +14 -24
- package/dist/types/utils/package-environment.d.mts +51 -72
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/types/utils/path-resolve.d.mts +9 -14
- package/dist/types/utils/pnpm.d.mts +9 -7
- package/dist/types/utils/pnpm.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts +8 -12
- package/dist/types/utils/semver.d.mts +5 -17
- package/dist/types/utils/serialize-result-json.d.mts +3 -3
- package/dist/types/utils/socket-package-alert.d.mts +62 -81
- package/dist/types/utils/socket-url.d.mts +9 -15
- package/dist/types/utils/spec.d.mts +4 -7
- package/dist/types/utils/spec.d.mts.map +1 -1
- package/dist/types/utils/strings.d.mts +2 -5
- package/dist/types/utils/translations.d.mts +592 -592
- package/dist/types/utils/walk-nested-map.d.mts +7 -10
- package/dist/utils.js +1531 -1833
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +38333 -51605
- package/dist/vendor.js.map +1 -1
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +5 -8
- package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +2 -4
- package/external/@socketsecurity/registry/external/cacache.js +1 -2
- package/external/@socketsecurity/registry/external/libnpmpack.js +36 -76
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +31 -67
- package/external/@socketsecurity/registry/external/pacote.js +36 -76
- package/external/@socketsecurity/registry/external/tinyglobby.js +3 -6
- package/external/@socketsecurity/registry/external/which.js +2 -4
- package/external/@socketsecurity/registry/lib/logger.d.ts +4 -1
- package/external/@socketsecurity/registry/lib/logger.js +160 -73
- package/external/@socketsecurity/registry/lib/spinner.js +5 -1
- package/external/@socketsecurity/registry/package.json +2 -2
- package/external/blessed/lib/alias.js +475 -468
- package/external/blessed/lib/blessed.js +12 -12
- package/external/blessed/lib/colors.js +234 -194
- package/external/blessed/lib/events.js +64 -70
- package/external/blessed/lib/gpmclient.js +117 -141
- package/external/blessed/lib/helpers.js +89 -94
- package/external/blessed/lib/keys.js +169 -342
- package/external/blessed/lib/program.js +2130 -2365
- package/external/blessed/lib/tput.js +1183 -1276
- package/external/blessed/lib/unicode.js +400 -522
- package/external/blessed/lib/widget.js +14 -14
- package/external/blessed/lib/widgets/ansiimage.js +90 -96
- package/external/blessed/lib/widgets/bigtext.js +91 -102
- package/external/blessed/lib/widgets/box.js +8 -8
- package/external/blessed/lib/widgets/button.js +23 -23
- package/external/blessed/lib/widgets/checkbox.js +50 -54
- package/external/blessed/lib/widgets/element.js +1415 -1716
- package/external/blessed/lib/widgets/filemanager.js +107 -118
- package/external/blessed/lib/widgets/form.js +144 -178
- package/external/blessed/lib/widgets/image.js +26 -36
- package/external/blessed/lib/widgets/input.js +8 -8
- package/external/blessed/lib/widgets/layout.js +103 -119
- package/external/blessed/lib/widgets/line.js +17 -20
- package/external/blessed/lib/widgets/list.js +349 -402
- package/external/blessed/lib/widgets/listbar.js +265 -306
- package/external/blessed/lib/widgets/listtable.js +133 -146
- package/external/blessed/lib/widgets/loading.js +31 -31
- package/external/blessed/lib/widgets/log.js +41 -40
- package/external/blessed/lib/widgets/message.js +64 -86
- package/external/blessed/lib/widgets/node.js +175 -207
- package/external/blessed/lib/widgets/overlayimage.js +360 -437
- package/external/blessed/lib/widgets/progressbar.js +79 -88
- package/external/blessed/lib/widgets/prompt.js +54 -61
- package/external/blessed/lib/widgets/question.js +48 -61
- package/external/blessed/lib/widgets/radiobutton.js +26 -27
- package/external/blessed/lib/widgets/radioset.js +8 -8
- package/external/blessed/lib/widgets/screen.js +1186 -1375
- package/external/blessed/lib/widgets/scrollablebox.js +202 -228
- package/external/blessed/lib/widgets/scrollabletext.js +9 -9
- package/external/blessed/lib/widgets/table.js +187 -216
- package/external/blessed/lib/widgets/terminal.js +258 -298
- package/external/blessed/lib/widgets/text.js +9 -9
- package/external/blessed/lib/widgets/textarea.js +188 -222
- package/external/blessed/lib/widgets/textbox.js +34 -36
- package/external/blessed/lib/widgets/video.js +55 -59
- package/external/blessed/usr/fonts/ter-u14b.json +1 -1
- package/external/blessed/usr/fonts/ter-u14n.json +1 -1
- package/external/blessed/vendor/tng.js +1016 -1144
- package/external/blessed-contrib/lib/layout/grid.js +345 -377
- package/external/blessed-contrib/lib/widget/charts/bar.js +6612 -7139
- package/external/blessed-contrib/lib/widget/charts/line.js +16224 -23941
- package/external/blessed-contrib/lib/widget/table.js +78 -96
- package/package.json +9 -9
- package/dist/types/commands/cdxgen/run-cdxgen.d.mts.map +0 -1
|
@@ -10,200 +10,190 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Box = require('./box');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* ScrollableBox
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
function ScrollableBox(options) {
|
|
21
|
-
|
|
21
|
+
var self = this;
|
|
22
22
|
|
|
23
23
|
if (!(this instanceof Node)) {
|
|
24
|
-
return new ScrollableBox(options)
|
|
24
|
+
return new ScrollableBox(options);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
options = options || {}
|
|
27
|
+
options = options || {};
|
|
28
28
|
|
|
29
|
-
Box.call(this, options)
|
|
29
|
+
Box.call(this, options);
|
|
30
30
|
|
|
31
31
|
if (options.scrollable === false) {
|
|
32
|
-
return this
|
|
32
|
+
return this;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
this.scrollable = true
|
|
36
|
-
this.childOffset = 0
|
|
37
|
-
this.childBase = 0
|
|
38
|
-
this.baseLimit = options.baseLimit || Infinity
|
|
39
|
-
this.alwaysScroll = options.alwaysScroll
|
|
35
|
+
this.scrollable = true;
|
|
36
|
+
this.childOffset = 0;
|
|
37
|
+
this.childBase = 0;
|
|
38
|
+
this.baseLimit = options.baseLimit || Infinity;
|
|
39
|
+
this.alwaysScroll = options.alwaysScroll;
|
|
40
40
|
|
|
41
|
-
this.scrollbar = options.scrollbar
|
|
41
|
+
this.scrollbar = options.scrollbar;
|
|
42
42
|
if (this.scrollbar) {
|
|
43
|
-
this.scrollbar.ch = this.scrollbar.ch || ' '
|
|
44
|
-
this.style.scrollbar = this.style.scrollbar || this.scrollbar.style
|
|
43
|
+
this.scrollbar.ch = this.scrollbar.ch || ' ';
|
|
44
|
+
this.style.scrollbar = this.style.scrollbar || this.scrollbar.style;
|
|
45
45
|
if (!this.style.scrollbar) {
|
|
46
|
-
this.style.scrollbar = {}
|
|
47
|
-
this.style.scrollbar.fg = this.scrollbar.fg
|
|
48
|
-
this.style.scrollbar.bg = this.scrollbar.bg
|
|
49
|
-
this.style.scrollbar.bold = this.scrollbar.bold
|
|
50
|
-
this.style.scrollbar.underline = this.scrollbar.underline
|
|
51
|
-
this.style.scrollbar.inverse = this.scrollbar.inverse
|
|
52
|
-
this.style.scrollbar.invisible = this.scrollbar.invisible
|
|
46
|
+
this.style.scrollbar = {};
|
|
47
|
+
this.style.scrollbar.fg = this.scrollbar.fg;
|
|
48
|
+
this.style.scrollbar.bg = this.scrollbar.bg;
|
|
49
|
+
this.style.scrollbar.bold = this.scrollbar.bold;
|
|
50
|
+
this.style.scrollbar.underline = this.scrollbar.underline;
|
|
51
|
+
this.style.scrollbar.inverse = this.scrollbar.inverse;
|
|
52
|
+
this.style.scrollbar.invisible = this.scrollbar.invisible;
|
|
53
53
|
}
|
|
54
54
|
//this.scrollbar.style = this.style.scrollbar;
|
|
55
55
|
if (this.track || this.scrollbar.track) {
|
|
56
|
-
this.track = this.scrollbar.track || this.track
|
|
57
|
-
this.style.track = this.style.scrollbar.track || this.style.track
|
|
58
|
-
this.track.ch = this.track.ch || ' '
|
|
59
|
-
this.style.track = this.style.track || this.track.style
|
|
56
|
+
this.track = this.scrollbar.track || this.track;
|
|
57
|
+
this.style.track = this.style.scrollbar.track || this.style.track;
|
|
58
|
+
this.track.ch = this.track.ch || ' ';
|
|
59
|
+
this.style.track = this.style.track || this.track.style;
|
|
60
60
|
if (!this.style.track) {
|
|
61
|
-
this.style.track = {}
|
|
62
|
-
this.style.track.fg = this.track.fg
|
|
63
|
-
this.style.track.bg = this.track.bg
|
|
64
|
-
this.style.track.bold = this.track.bold
|
|
65
|
-
this.style.track.underline = this.track.underline
|
|
66
|
-
this.style.track.inverse = this.track.inverse
|
|
67
|
-
this.style.track.invisible = this.track.invisible
|
|
61
|
+
this.style.track = {};
|
|
62
|
+
this.style.track.fg = this.track.fg;
|
|
63
|
+
this.style.track.bg = this.track.bg;
|
|
64
|
+
this.style.track.bold = this.track.bold;
|
|
65
|
+
this.style.track.underline = this.track.underline;
|
|
66
|
+
this.style.track.inverse = this.track.inverse;
|
|
67
|
+
this.style.track.invisible = this.track.invisible;
|
|
68
68
|
}
|
|
69
|
-
this.track.style = this.style.track
|
|
69
|
+
this.track.style = this.style.track;
|
|
70
70
|
}
|
|
71
71
|
// Allow controlling of the scrollbar via the mouse:
|
|
72
72
|
if (options.mouse) {
|
|
73
|
-
this.on('mousedown', function
|
|
73
|
+
this.on('mousedown', function(data) {
|
|
74
74
|
if (self._scrollingBar) {
|
|
75
75
|
// Do not allow dragging on the scrollbar:
|
|
76
|
-
delete self.screen._dragging
|
|
77
|
-
delete self._drag
|
|
78
|
-
return
|
|
76
|
+
delete self.screen._dragging;
|
|
77
|
+
delete self._drag;
|
|
78
|
+
return;
|
|
79
79
|
}
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
var x = data.x - self.aleft;
|
|
81
|
+
var y = data.y - self.atop;
|
|
82
82
|
if (x === self.width - self.iright - 1) {
|
|
83
83
|
// Do not allow dragging on the scrollbar:
|
|
84
|
-
delete self.screen._dragging
|
|
85
|
-
delete self._drag
|
|
86
|
-
|
|
87
|
-
self.setScrollPerc(
|
|
88
|
-
self.screen.render()
|
|
89
|
-
|
|
90
|
-
self._scrollingBar = true
|
|
91
|
-
self.onScreenEvent(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
self.screen.render()
|
|
98
|
-
})
|
|
99
|
-
)
|
|
84
|
+
delete self.screen._dragging;
|
|
85
|
+
delete self._drag;
|
|
86
|
+
var perc = (y - self.itop) / (self.height - self.iheight);
|
|
87
|
+
self.setScrollPerc(perc * 100 | 0);
|
|
88
|
+
self.screen.render();
|
|
89
|
+
var smd, smu;
|
|
90
|
+
self._scrollingBar = true;
|
|
91
|
+
self.onScreenEvent('mousedown', smd = function(data) {
|
|
92
|
+
var y = data.y - self.atop;
|
|
93
|
+
var perc = y / self.height;
|
|
94
|
+
self.setScrollPerc(perc * 100 | 0);
|
|
95
|
+
self.screen.render();
|
|
96
|
+
});
|
|
100
97
|
// If mouseup occurs out of the window, no mouseup event fires, and
|
|
101
98
|
// scrollbar will drag again on mousedown until another mouseup
|
|
102
99
|
// occurs.
|
|
103
|
-
self.onScreenEvent(
|
|
104
|
-
|
|
105
|
-
(
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
self.removeScreenEvent('mouseup', smu)
|
|
109
|
-
})
|
|
110
|
-
)
|
|
100
|
+
self.onScreenEvent('mouseup', smu = function() {
|
|
101
|
+
self._scrollingBar = false;
|
|
102
|
+
self.removeScreenEvent('mousedown', smd);
|
|
103
|
+
self.removeScreenEvent('mouseup', smu);
|
|
104
|
+
});
|
|
111
105
|
}
|
|
112
|
-
})
|
|
106
|
+
});
|
|
113
107
|
}
|
|
114
108
|
}
|
|
115
109
|
|
|
116
110
|
if (options.mouse) {
|
|
117
|
-
this.on('wheeldown', function
|
|
118
|
-
self.scroll(
|
|
119
|
-
self.screen.render()
|
|
120
|
-
})
|
|
121
|
-
this.on('wheelup', function
|
|
122
|
-
self.scroll(-(
|
|
123
|
-
self.screen.render()
|
|
124
|
-
})
|
|
111
|
+
this.on('wheeldown', function() {
|
|
112
|
+
self.scroll(self.height / 2 | 0 || 1);
|
|
113
|
+
self.screen.render();
|
|
114
|
+
});
|
|
115
|
+
this.on('wheelup', function() {
|
|
116
|
+
self.scroll(-(self.height / 2 | 0) || -1);
|
|
117
|
+
self.screen.render();
|
|
118
|
+
});
|
|
125
119
|
}
|
|
126
120
|
|
|
127
121
|
if (options.keys && !options.ignoreKeys) {
|
|
128
|
-
this.on('keypress', function
|
|
122
|
+
this.on('keypress', function(ch, key) {
|
|
129
123
|
if (key.name === 'up' || (options.vi && key.name === 'k')) {
|
|
130
|
-
self.scroll(-1)
|
|
131
|
-
self.screen.render()
|
|
132
|
-
return
|
|
124
|
+
self.scroll(-1);
|
|
125
|
+
self.screen.render();
|
|
126
|
+
return;
|
|
133
127
|
}
|
|
134
128
|
if (key.name === 'down' || (options.vi && key.name === 'j')) {
|
|
135
|
-
self.scroll(1)
|
|
136
|
-
self.screen.render()
|
|
137
|
-
return
|
|
129
|
+
self.scroll(1);
|
|
130
|
+
self.screen.render();
|
|
131
|
+
return;
|
|
138
132
|
}
|
|
139
133
|
if (options.vi && key.name === 'u' && key.ctrl) {
|
|
140
|
-
self.scroll(-(
|
|
141
|
-
self.screen.render()
|
|
142
|
-
return
|
|
134
|
+
self.scroll(-(self.height / 2 | 0) || -1);
|
|
135
|
+
self.screen.render();
|
|
136
|
+
return;
|
|
143
137
|
}
|
|
144
138
|
if (options.vi && key.name === 'd' && key.ctrl) {
|
|
145
|
-
self.scroll(
|
|
146
|
-
self.screen.render()
|
|
147
|
-
return
|
|
139
|
+
self.scroll(self.height / 2 | 0 || 1);
|
|
140
|
+
self.screen.render();
|
|
141
|
+
return;
|
|
148
142
|
}
|
|
149
143
|
if (options.vi && key.name === 'b' && key.ctrl) {
|
|
150
|
-
self.scroll(-self.height || -1)
|
|
151
|
-
self.screen.render()
|
|
152
|
-
return
|
|
144
|
+
self.scroll(-self.height || -1);
|
|
145
|
+
self.screen.render();
|
|
146
|
+
return;
|
|
153
147
|
}
|
|
154
148
|
if (options.vi && key.name === 'f' && key.ctrl) {
|
|
155
|
-
self.scroll(self.height || 1)
|
|
156
|
-
self.screen.render()
|
|
157
|
-
return
|
|
149
|
+
self.scroll(self.height || 1);
|
|
150
|
+
self.screen.render();
|
|
151
|
+
return;
|
|
158
152
|
}
|
|
159
153
|
if (options.vi && key.name === 'g' && !key.shift) {
|
|
160
|
-
self.scrollTo(0)
|
|
161
|
-
self.screen.render()
|
|
162
|
-
return
|
|
154
|
+
self.scrollTo(0);
|
|
155
|
+
self.screen.render();
|
|
156
|
+
return;
|
|
163
157
|
}
|
|
164
158
|
if (options.vi && key.name === 'g' && key.shift) {
|
|
165
|
-
self.scrollTo(self.getScrollHeight())
|
|
166
|
-
self.screen.render()
|
|
167
|
-
return
|
|
159
|
+
self.scrollTo(self.getScrollHeight());
|
|
160
|
+
self.screen.render();
|
|
161
|
+
return;
|
|
168
162
|
}
|
|
169
|
-
})
|
|
163
|
+
});
|
|
170
164
|
}
|
|
171
165
|
|
|
172
|
-
this.on('parsed content', function
|
|
173
|
-
self._recalculateIndex()
|
|
174
|
-
})
|
|
166
|
+
this.on('parsed content', function() {
|
|
167
|
+
self._recalculateIndex();
|
|
168
|
+
});
|
|
175
169
|
|
|
176
|
-
self._recalculateIndex()
|
|
170
|
+
self._recalculateIndex();
|
|
177
171
|
}
|
|
178
172
|
|
|
179
|
-
Object.setPrototypeOf(ScrollableBox.prototype, Box.prototype)
|
|
173
|
+
Object.setPrototypeOf(ScrollableBox.prototype, Box.prototype);
|
|
180
174
|
|
|
181
|
-
ScrollableBox.prototype.type = 'scrollable-box'
|
|
175
|
+
ScrollableBox.prototype.type = 'scrollable-box';
|
|
182
176
|
|
|
183
177
|
// XXX Potentially use this in place of scrollable checks elsewhere.
|
|
184
|
-
ScrollableBox.prototype.__defineGetter__('reallyScrollable', function
|
|
185
|
-
if (this.shrink)
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return this.getScrollHeight() > this.height
|
|
189
|
-
})
|
|
178
|
+
ScrollableBox.prototype.__defineGetter__('reallyScrollable', function() {
|
|
179
|
+
if (this.shrink) return this.scrollable;
|
|
180
|
+
return this.getScrollHeight() > this.height;
|
|
181
|
+
});
|
|
190
182
|
|
|
191
|
-
ScrollableBox.prototype._scrollBottom = function
|
|
192
|
-
if (!this.scrollable)
|
|
193
|
-
return 0
|
|
194
|
-
}
|
|
183
|
+
ScrollableBox.prototype._scrollBottom = function() {
|
|
184
|
+
if (!this.scrollable) return 0;
|
|
195
185
|
|
|
196
186
|
// We could just calculate the children, but we can
|
|
197
187
|
// optimize for lists by just returning the items.length.
|
|
198
188
|
if (this._isList) {
|
|
199
|
-
return this.items ? this.items.length : 0
|
|
189
|
+
return this.items ? this.items.length : 0;
|
|
200
190
|
}
|
|
201
191
|
|
|
202
192
|
if (this.lpos && this.lpos._scrollBottom) {
|
|
203
|
-
return this.lpos._scrollBottom
|
|
193
|
+
return this.lpos._scrollBottom;
|
|
204
194
|
}
|
|
205
195
|
|
|
206
|
-
|
|
196
|
+
var bottom = this.children.reduce(function(current, el) {
|
|
207
197
|
// el.height alone does not calculate the shrunken height, we need to use
|
|
208
198
|
// getCoords. A shrunken box inside a scrollable element will not grow any
|
|
209
199
|
// larger than the scrollable element's context regardless of how much
|
|
@@ -211,207 +201,191 @@ ScrollableBox.prototype._scrollBottom = function () {
|
|
|
211
201
|
// without the scrollable calculation):
|
|
212
202
|
// See: $ node test/widget-shrink-fail-2.js
|
|
213
203
|
if (!el.detached) {
|
|
214
|
-
|
|
204
|
+
var lpos = el._getCoords(false, true);
|
|
215
205
|
if (lpos) {
|
|
216
|
-
return Math.max(current, el.rtop + (lpos.yl - lpos.yi))
|
|
206
|
+
return Math.max(current, el.rtop + (lpos.yl - lpos.yi));
|
|
217
207
|
}
|
|
218
208
|
}
|
|
219
|
-
return Math.max(current, el.rtop + el.height)
|
|
220
|
-
}, 0)
|
|
209
|
+
return Math.max(current, el.rtop + el.height);
|
|
210
|
+
}, 0);
|
|
221
211
|
|
|
222
212
|
// XXX Use this? Makes .getScrollHeight() useless!
|
|
223
213
|
// if (bottom < this._clines.length) bottom = this._clines.length;
|
|
224
214
|
|
|
225
|
-
if (this.lpos)
|
|
226
|
-
this.lpos._scrollBottom = bottom
|
|
227
|
-
}
|
|
215
|
+
if (this.lpos) this.lpos._scrollBottom = bottom;
|
|
228
216
|
|
|
229
|
-
return bottom
|
|
230
|
-
}
|
|
217
|
+
return bottom;
|
|
218
|
+
};
|
|
231
219
|
|
|
232
|
-
ScrollableBox.prototype.setScroll =
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
220
|
+
ScrollableBox.prototype.setScroll =
|
|
221
|
+
ScrollableBox.prototype.scrollTo = function(offset, always) {
|
|
222
|
+
// XXX
|
|
223
|
+
// At first, this appeared to account for the first new calculation of childBase:
|
|
224
|
+
this.scroll(0);
|
|
225
|
+
return this.scroll(offset - (this.childBase + this.childOffset), always);
|
|
226
|
+
};
|
|
239
227
|
|
|
240
|
-
ScrollableBox.prototype.getScroll = function
|
|
241
|
-
return this.childBase + this.childOffset
|
|
242
|
-
}
|
|
228
|
+
ScrollableBox.prototype.getScroll = function() {
|
|
229
|
+
return this.childBase + this.childOffset;
|
|
230
|
+
};
|
|
243
231
|
|
|
244
|
-
ScrollableBox.prototype.scroll = function
|
|
245
|
-
if (!this.scrollable)
|
|
246
|
-
return
|
|
247
|
-
}
|
|
232
|
+
ScrollableBox.prototype.scroll = function(offset, always) {
|
|
233
|
+
if (!this.scrollable) return;
|
|
248
234
|
|
|
249
|
-
if (this.detached)
|
|
250
|
-
return
|
|
251
|
-
}
|
|
235
|
+
if (this.detached) return;
|
|
252
236
|
|
|
253
237
|
// Handle scrolling.
|
|
254
|
-
|
|
255
|
-
base = this.childBase
|
|
256
|
-
d
|
|
257
|
-
p
|
|
258
|
-
t
|
|
259
|
-
b
|
|
260
|
-
max
|
|
261
|
-
emax
|
|
238
|
+
var visible = this.height - this.iheight
|
|
239
|
+
, base = this.childBase
|
|
240
|
+
, d
|
|
241
|
+
, p
|
|
242
|
+
, t
|
|
243
|
+
, b
|
|
244
|
+
, max
|
|
245
|
+
, emax;
|
|
262
246
|
|
|
263
247
|
if (this.alwaysScroll || always) {
|
|
264
248
|
// Semi-workaround
|
|
265
|
-
this.childOffset = offset > 0
|
|
249
|
+
this.childOffset = offset > 0
|
|
250
|
+
? visible - 1 + offset
|
|
251
|
+
: offset;
|
|
266
252
|
} else {
|
|
267
|
-
this.childOffset += offset
|
|
253
|
+
this.childOffset += offset;
|
|
268
254
|
}
|
|
269
255
|
|
|
270
256
|
if (this.childOffset > visible - 1) {
|
|
271
|
-
d = this.childOffset - (visible - 1)
|
|
272
|
-
this.childOffset -= d
|
|
273
|
-
this.childBase += d
|
|
257
|
+
d = this.childOffset - (visible - 1);
|
|
258
|
+
this.childOffset -= d;
|
|
259
|
+
this.childBase += d;
|
|
274
260
|
} else if (this.childOffset < 0) {
|
|
275
|
-
d = this.childOffset
|
|
276
|
-
this.childOffset += -d
|
|
277
|
-
this.childBase += d
|
|
261
|
+
d = this.childOffset;
|
|
262
|
+
this.childOffset += -d;
|
|
263
|
+
this.childBase += d;
|
|
278
264
|
}
|
|
279
265
|
|
|
280
266
|
if (this.childBase < 0) {
|
|
281
|
-
this.childBase = 0
|
|
267
|
+
this.childBase = 0;
|
|
282
268
|
} else if (this.childBase > this.baseLimit) {
|
|
283
|
-
this.childBase = this.baseLimit
|
|
269
|
+
this.childBase = this.baseLimit;
|
|
284
270
|
}
|
|
285
271
|
|
|
286
272
|
// Find max "bottom" value for
|
|
287
273
|
// content and descendant elements.
|
|
288
274
|
// Scroll the content if necessary.
|
|
289
275
|
if (this.childBase === base) {
|
|
290
|
-
return this.emit('scroll')
|
|
276
|
+
return this.emit('scroll');
|
|
291
277
|
}
|
|
292
278
|
|
|
293
279
|
// When scrolling text, we want to be able to handle SGR codes as well as line
|
|
294
280
|
// feeds. This allows us to take preformatted text output from other programs
|
|
295
281
|
// and put it in a scrollable text box.
|
|
296
|
-
this.parseContent()
|
|
282
|
+
this.parseContent();
|
|
297
283
|
|
|
298
284
|
// XXX
|
|
299
285
|
// max = this.getScrollHeight() - (this.height - this.iheight);
|
|
300
286
|
|
|
301
|
-
max = this._clines.length - (this.height - this.iheight)
|
|
302
|
-
if (max < 0)
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
emax = this._scrollBottom() - (this.height - this.iheight)
|
|
306
|
-
if (emax < 0) {
|
|
307
|
-
emax = 0
|
|
308
|
-
}
|
|
287
|
+
max = this._clines.length - (this.height - this.iheight);
|
|
288
|
+
if (max < 0) max = 0;
|
|
289
|
+
emax = this._scrollBottom() - (this.height - this.iheight);
|
|
290
|
+
if (emax < 0) emax = 0;
|
|
309
291
|
|
|
310
|
-
this.childBase = Math.min(this.childBase, Math.max(emax, max))
|
|
292
|
+
this.childBase = Math.min(this.childBase, Math.max(emax, max));
|
|
311
293
|
|
|
312
294
|
if (this.childBase < 0) {
|
|
313
|
-
this.childBase = 0
|
|
295
|
+
this.childBase = 0;
|
|
314
296
|
} else if (this.childBase > this.baseLimit) {
|
|
315
|
-
this.childBase = this.baseLimit
|
|
297
|
+
this.childBase = this.baseLimit;
|
|
316
298
|
}
|
|
317
299
|
|
|
318
300
|
// Optimize scrolling with CSR + IL/DL.
|
|
319
|
-
p = this.lpos
|
|
301
|
+
p = this.lpos;
|
|
320
302
|
// Only really need _getCoords() if we want
|
|
321
303
|
// to allow nestable scrolling elements...
|
|
322
304
|
// or if we **really** want shrinkable
|
|
323
305
|
// scrolling elements.
|
|
324
306
|
// p = this._getCoords();
|
|
325
307
|
if (p && this.childBase !== base && this.screen.cleanSides(this)) {
|
|
326
|
-
t = p.yi + this.itop
|
|
327
|
-
b = p.yl - this.ibottom - 1
|
|
328
|
-
d = this.childBase - base
|
|
308
|
+
t = p.yi + this.itop;
|
|
309
|
+
b = p.yl - this.ibottom - 1;
|
|
310
|
+
d = this.childBase - base;
|
|
329
311
|
|
|
330
312
|
if (d > 0 && d < visible) {
|
|
331
313
|
// scrolled down
|
|
332
|
-
this.screen.deleteLine(d, t, t, b)
|
|
314
|
+
this.screen.deleteLine(d, t, t, b);
|
|
333
315
|
} else if (d < 0 && -d < visible) {
|
|
334
316
|
// scrolled up
|
|
335
|
-
d = -d
|
|
336
|
-
this.screen.insertLine(d, t, t, b)
|
|
317
|
+
d = -d;
|
|
318
|
+
this.screen.insertLine(d, t, t, b);
|
|
337
319
|
}
|
|
338
320
|
}
|
|
339
321
|
|
|
340
|
-
return this.emit('scroll')
|
|
341
|
-
}
|
|
322
|
+
return this.emit('scroll');
|
|
323
|
+
};
|
|
342
324
|
|
|
343
|
-
ScrollableBox.prototype._recalculateIndex = function
|
|
344
|
-
|
|
325
|
+
ScrollableBox.prototype._recalculateIndex = function() {
|
|
326
|
+
var max, emax;
|
|
345
327
|
|
|
346
328
|
if (this.detached || !this.scrollable) {
|
|
347
|
-
return 0
|
|
329
|
+
return 0;
|
|
348
330
|
}
|
|
349
331
|
|
|
350
332
|
// XXX
|
|
351
333
|
// max = this.getScrollHeight() - (this.height - this.iheight);
|
|
352
334
|
|
|
353
|
-
max = this._clines.length - (this.height - this.iheight)
|
|
354
|
-
if (max < 0)
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
emax = this._scrollBottom() - (this.height - this.iheight)
|
|
358
|
-
if (emax < 0) {
|
|
359
|
-
emax = 0
|
|
360
|
-
}
|
|
335
|
+
max = this._clines.length - (this.height - this.iheight);
|
|
336
|
+
if (max < 0) max = 0;
|
|
337
|
+
emax = this._scrollBottom() - (this.height - this.iheight);
|
|
338
|
+
if (emax < 0) emax = 0;
|
|
361
339
|
|
|
362
|
-
this.childBase = Math.min(this.childBase, Math.max(emax, max))
|
|
340
|
+
this.childBase = Math.min(this.childBase, Math.max(emax, max));
|
|
363
341
|
|
|
364
342
|
if (this.childBase < 0) {
|
|
365
|
-
this.childBase = 0
|
|
343
|
+
this.childBase = 0;
|
|
366
344
|
} else if (this.childBase > this.baseLimit) {
|
|
367
|
-
this.childBase = this.baseLimit
|
|
345
|
+
this.childBase = this.baseLimit;
|
|
368
346
|
}
|
|
369
|
-
}
|
|
347
|
+
};
|
|
370
348
|
|
|
371
|
-
ScrollableBox.prototype.resetScroll = function
|
|
372
|
-
if (!this.scrollable)
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
this.
|
|
376
|
-
|
|
377
|
-
return this.emit('scroll')
|
|
378
|
-
}
|
|
349
|
+
ScrollableBox.prototype.resetScroll = function() {
|
|
350
|
+
if (!this.scrollable) return;
|
|
351
|
+
this.childOffset = 0;
|
|
352
|
+
this.childBase = 0;
|
|
353
|
+
return this.emit('scroll');
|
|
354
|
+
};
|
|
379
355
|
|
|
380
|
-
ScrollableBox.prototype.getScrollHeight = function
|
|
381
|
-
return Math.max(this._clines.length, this._scrollBottom())
|
|
382
|
-
}
|
|
356
|
+
ScrollableBox.prototype.getScrollHeight = function() {
|
|
357
|
+
return Math.max(this._clines.length, this._scrollBottom());
|
|
358
|
+
};
|
|
383
359
|
|
|
384
|
-
ScrollableBox.prototype.getScrollPerc = function
|
|
385
|
-
|
|
386
|
-
if (!pos)
|
|
387
|
-
return s ? -1 : 0
|
|
388
|
-
}
|
|
360
|
+
ScrollableBox.prototype.getScrollPerc = function(s) {
|
|
361
|
+
var pos = this.lpos || this._getCoords();
|
|
362
|
+
if (!pos) return s ? -1 : 0;
|
|
389
363
|
|
|
390
|
-
|
|
391
|
-
i = this.getScrollHeight()
|
|
392
|
-
p
|
|
364
|
+
var height = (pos.yl - pos.yi) - this.iheight
|
|
365
|
+
, i = this.getScrollHeight()
|
|
366
|
+
, p;
|
|
393
367
|
|
|
394
368
|
if (height < i) {
|
|
395
369
|
if (this.alwaysScroll) {
|
|
396
|
-
p = this.childBase / (i - height)
|
|
370
|
+
p = this.childBase / (i - height);
|
|
397
371
|
} else {
|
|
398
|
-
p = (this.childBase + this.childOffset) / (i - 1)
|
|
372
|
+
p = (this.childBase + this.childOffset) / (i - 1);
|
|
399
373
|
}
|
|
400
|
-
return p * 100
|
|
374
|
+
return p * 100;
|
|
401
375
|
}
|
|
402
376
|
|
|
403
|
-
return s ? -1 : 0
|
|
404
|
-
}
|
|
377
|
+
return s ? -1 : 0;
|
|
378
|
+
};
|
|
405
379
|
|
|
406
|
-
ScrollableBox.prototype.setScrollPerc = function
|
|
380
|
+
ScrollableBox.prototype.setScrollPerc = function(i) {
|
|
407
381
|
// XXX
|
|
408
382
|
// var m = this.getScrollHeight();
|
|
409
|
-
|
|
410
|
-
return this.scrollTo((
|
|
411
|
-
}
|
|
383
|
+
var m = Math.max(this._clines.length, this._scrollBottom());
|
|
384
|
+
return this.scrollTo((i / 100) * m | 0);
|
|
385
|
+
};
|
|
412
386
|
|
|
413
387
|
/**
|
|
414
388
|
* Expose
|
|
415
389
|
*/
|
|
416
390
|
|
|
417
|
-
module.exports = ScrollableBox
|
|
391
|
+
module.exports = ScrollableBox;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var ScrollableBox = require('./scrollablebox');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* ScrollableText
|
|
@@ -19,19 +19,19 @@ const ScrollableBox = require('./scrollablebox')
|
|
|
19
19
|
|
|
20
20
|
function ScrollableText(options) {
|
|
21
21
|
if (!(this instanceof Node)) {
|
|
22
|
-
return new ScrollableText(options)
|
|
22
|
+
return new ScrollableText(options);
|
|
23
23
|
}
|
|
24
|
-
options = options || {}
|
|
25
|
-
options.alwaysScroll = true
|
|
26
|
-
ScrollableBox.call(this, options)
|
|
24
|
+
options = options || {};
|
|
25
|
+
options.alwaysScroll = true;
|
|
26
|
+
ScrollableBox.call(this, options);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
Object.setPrototypeOf(ScrollableText.prototype, ScrollableBox.prototype)
|
|
29
|
+
Object.setPrototypeOf(ScrollableText.prototype, ScrollableBox.prototype);
|
|
30
30
|
|
|
31
|
-
ScrollableText.prototype.type = 'scrollable-text'
|
|
31
|
+
ScrollableText.prototype.type = 'scrollable-text';
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Expose
|
|
35
35
|
*/
|
|
36
36
|
|
|
37
|
-
module.exports = ScrollableText
|
|
37
|
+
module.exports = ScrollableText;
|