@socketsecurity/cli-with-sentry 0.15.11 → 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 +3 -1
- package/external/@socketsecurity/registry/lib/logger.js +149 -69
- 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 +8 -8
- package/dist/types/commands/cdxgen/run-cdxgen.d.mts.map +0 -1
|
@@ -10,445 +10,404 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var helpers = require('../helpers');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var Node = require('./node');
|
|
16
|
+
var Box = require('./box');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Listbar / HorizontalList
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
function Listbar(options) {
|
|
23
|
-
|
|
23
|
+
var self = this;
|
|
24
24
|
|
|
25
25
|
if (!(this instanceof Node)) {
|
|
26
|
-
return new Listbar(options)
|
|
26
|
+
return new Listbar(options);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
options = options || {}
|
|
29
|
+
options = options || {};
|
|
30
30
|
|
|
31
|
-
this.items = []
|
|
32
|
-
this.ritems = []
|
|
33
|
-
this.commands = []
|
|
31
|
+
this.items = [];
|
|
32
|
+
this.ritems = [];
|
|
33
|
+
this.commands = [];
|
|
34
34
|
|
|
35
|
-
this.leftBase = 0
|
|
36
|
-
this.leftOffset = 0
|
|
35
|
+
this.leftBase = 0;
|
|
36
|
+
this.leftOffset = 0;
|
|
37
37
|
|
|
38
|
-
this.mouse = options.mouse || false
|
|
38
|
+
this.mouse = options.mouse || false;
|
|
39
39
|
|
|
40
|
-
Box.call(this, options)
|
|
40
|
+
Box.call(this, options);
|
|
41
41
|
|
|
42
42
|
if (!this.style.selected) {
|
|
43
|
-
this.style.selected = {}
|
|
43
|
+
this.style.selected = {};
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
if (!this.style.item) {
|
|
47
|
-
this.style.item = {}
|
|
47
|
+
this.style.item = {};
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
if (options.commands || options.items) {
|
|
51
|
-
this.setItems(options.commands || options.items)
|
|
51
|
+
this.setItems(options.commands || options.items);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
if (options.keys) {
|
|
55
|
-
this.on('keypress', function
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
self.moveLeft()
|
|
62
|
-
self.screen.render()
|
|
55
|
+
this.on('keypress', function(ch, key) {
|
|
56
|
+
if (key.name === 'left'
|
|
57
|
+
|| (options.vi && key.name === 'h')
|
|
58
|
+
|| (key.shift && key.name === 'tab')) {
|
|
59
|
+
self.moveLeft();
|
|
60
|
+
self.screen.render();
|
|
63
61
|
// Stop propagation if we're in a form.
|
|
64
|
-
if (key.name === 'tab')
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
return
|
|
62
|
+
if (key.name === 'tab') return false;
|
|
63
|
+
return;
|
|
68
64
|
}
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
self.moveRight()
|
|
75
|
-
self.screen.render()
|
|
65
|
+
if (key.name === 'right'
|
|
66
|
+
|| (options.vi && key.name === 'l')
|
|
67
|
+
|| key.name === 'tab') {
|
|
68
|
+
self.moveRight();
|
|
69
|
+
self.screen.render();
|
|
76
70
|
// Stop propagation if we're in a form.
|
|
77
|
-
if (key.name === 'tab')
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
return
|
|
71
|
+
if (key.name === 'tab') return false;
|
|
72
|
+
return;
|
|
81
73
|
}
|
|
82
|
-
if (
|
|
83
|
-
|
|
84
|
-
(
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
self.emit('select', self.items[self.selected], self.selected)
|
|
88
|
-
const item = self.items[self.selected]
|
|
74
|
+
if (key.name === 'enter'
|
|
75
|
+
|| (options.vi && key.name === 'k' && !key.shift)) {
|
|
76
|
+
self.emit('action', self.items[self.selected], self.selected);
|
|
77
|
+
self.emit('select', self.items[self.selected], self.selected);
|
|
78
|
+
var item = self.items[self.selected];
|
|
89
79
|
if (item._.cmd.callback) {
|
|
90
|
-
item._.cmd.callback()
|
|
80
|
+
item._.cmd.callback();
|
|
91
81
|
}
|
|
92
|
-
self.screen.render()
|
|
93
|
-
return
|
|
82
|
+
self.screen.render();
|
|
83
|
+
return;
|
|
94
84
|
}
|
|
95
85
|
if (key.name === 'escape' || (options.vi && key.name === 'q')) {
|
|
96
|
-
self.emit('action')
|
|
97
|
-
self.emit('cancel')
|
|
98
|
-
return
|
|
86
|
+
self.emit('action');
|
|
87
|
+
self.emit('cancel');
|
|
88
|
+
return;
|
|
99
89
|
}
|
|
100
|
-
})
|
|
90
|
+
});
|
|
101
91
|
}
|
|
102
92
|
|
|
103
93
|
if (options.autoCommandKeys) {
|
|
104
|
-
this.onScreenEvent('keypress', function
|
|
94
|
+
this.onScreenEvent('keypress', function(ch) {
|
|
105
95
|
if (/^[0-9]$/.test(ch)) {
|
|
106
|
-
|
|
107
|
-
if (!~i)
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
return self.selectTab(i)
|
|
96
|
+
var i = +ch - 1;
|
|
97
|
+
if (!~i) i = 9;
|
|
98
|
+
return self.selectTab(i);
|
|
111
99
|
}
|
|
112
|
-
})
|
|
100
|
+
});
|
|
113
101
|
}
|
|
114
102
|
|
|
115
|
-
this.on('focus', function
|
|
116
|
-
self.select(self.selected)
|
|
117
|
-
})
|
|
103
|
+
this.on('focus', function() {
|
|
104
|
+
self.select(self.selected);
|
|
105
|
+
});
|
|
118
106
|
}
|
|
119
107
|
|
|
120
|
-
Object.setPrototypeOf(Listbar.prototype, Box.prototype)
|
|
108
|
+
Object.setPrototypeOf(Listbar.prototype, Box.prototype);
|
|
121
109
|
|
|
122
|
-
Listbar.prototype.type = 'listbar'
|
|
110
|
+
Listbar.prototype.type = 'listbar';
|
|
123
111
|
|
|
124
|
-
Listbar.prototype.__defineGetter__('selected', function
|
|
125
|
-
return this.leftBase + this.leftOffset
|
|
126
|
-
})
|
|
112
|
+
Listbar.prototype.__defineGetter__('selected', function() {
|
|
113
|
+
return this.leftBase + this.leftOffset;
|
|
114
|
+
});
|
|
127
115
|
|
|
128
|
-
Listbar.prototype.setItems = function
|
|
129
|
-
|
|
116
|
+
Listbar.prototype.setItems = function(commands) {
|
|
117
|
+
var self = this;
|
|
130
118
|
|
|
131
119
|
if (!Array.isArray(commands)) {
|
|
132
|
-
commands = Object.keys(commands).reduce(function
|
|
133
|
-
|
|
134
|
-
cb
|
|
120
|
+
commands = Object.keys(commands).reduce(function(obj, key, i) {
|
|
121
|
+
var cmd = commands[key]
|
|
122
|
+
, cb;
|
|
135
123
|
|
|
136
124
|
if (typeof cmd === 'function') {
|
|
137
|
-
cb = cmd
|
|
138
|
-
cmd = { callback: cb }
|
|
125
|
+
cb = cmd;
|
|
126
|
+
cmd = { callback: cb };
|
|
139
127
|
}
|
|
140
128
|
|
|
141
|
-
if (cmd.text == null)
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
if (cmd.prefix == null) {
|
|
145
|
-
cmd.prefix = ++i + ''
|
|
146
|
-
}
|
|
129
|
+
if (cmd.text == null) cmd.text = key;
|
|
130
|
+
if (cmd.prefix == null) cmd.prefix = ++i + '';
|
|
147
131
|
|
|
148
132
|
if (cmd.text == null && cmd.callback) {
|
|
149
|
-
cmd.text = cmd.callback.name
|
|
133
|
+
cmd.text = cmd.callback.name;
|
|
150
134
|
}
|
|
151
135
|
|
|
152
|
-
obj.push(cmd)
|
|
136
|
+
obj.push(cmd);
|
|
153
137
|
|
|
154
|
-
return obj
|
|
155
|
-
}, [])
|
|
138
|
+
return obj;
|
|
139
|
+
}, []);
|
|
156
140
|
}
|
|
157
141
|
|
|
158
|
-
this.items.forEach(function
|
|
159
|
-
el.detach()
|
|
160
|
-
})
|
|
142
|
+
this.items.forEach(function(el) {
|
|
143
|
+
el.detach();
|
|
144
|
+
});
|
|
161
145
|
|
|
162
|
-
this.items = []
|
|
163
|
-
this.ritems = []
|
|
164
|
-
this.commands = []
|
|
146
|
+
this.items = [];
|
|
147
|
+
this.ritems = [];
|
|
148
|
+
this.commands = [];
|
|
165
149
|
|
|
166
|
-
commands.forEach(function
|
|
167
|
-
self.add(cmd)
|
|
168
|
-
})
|
|
150
|
+
commands.forEach(function(cmd) {
|
|
151
|
+
self.add(cmd);
|
|
152
|
+
});
|
|
169
153
|
|
|
170
|
-
this.emit('set items')
|
|
171
|
-
}
|
|
154
|
+
this.emit('set items');
|
|
155
|
+
};
|
|
172
156
|
|
|
173
157
|
Listbar.prototype.add =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
len
|
|
183
|
-
|
|
184
|
-
if (!this.parent) {
|
|
185
|
-
drawn = 0
|
|
186
|
-
} else {
|
|
187
|
-
drawn = prev ? prev.aleft + prev.width : 0
|
|
188
|
-
if (!this.screen.autoPadding) {
|
|
189
|
-
drawn += this.ileft
|
|
190
|
-
}
|
|
191
|
-
}
|
|
158
|
+
Listbar.prototype.addItem =
|
|
159
|
+
Listbar.prototype.appendItem = function(item, callback) {
|
|
160
|
+
var self = this
|
|
161
|
+
, prev = this.items[this.items.length - 1]
|
|
162
|
+
, drawn
|
|
163
|
+
, cmd
|
|
164
|
+
, title
|
|
165
|
+
, len;
|
|
192
166
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
167
|
+
if (!this.parent) {
|
|
168
|
+
drawn = 0;
|
|
169
|
+
} else {
|
|
170
|
+
drawn = prev ? prev.aleft + prev.width : 0;
|
|
171
|
+
if (!this.screen.autoPadding) {
|
|
172
|
+
drawn += this.ileft;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
199
175
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
callback: callback
|
|
205
|
-
}
|
|
206
|
-
}
|
|
176
|
+
if (typeof item === 'object') {
|
|
177
|
+
cmd = item;
|
|
178
|
+
if (cmd.prefix == null) cmd.prefix = (this.items.length + 1) + '';
|
|
179
|
+
}
|
|
207
180
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
181
|
+
if (typeof item === 'string') {
|
|
182
|
+
cmd = {
|
|
183
|
+
prefix: (this.items.length + 1) + '',
|
|
184
|
+
text: item,
|
|
185
|
+
callback: callback
|
|
186
|
+
};
|
|
187
|
+
}
|
|
215
188
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
189
|
+
if (typeof item === 'function') {
|
|
190
|
+
cmd = {
|
|
191
|
+
prefix: (this.items.length + 1) + '',
|
|
192
|
+
text: item.name,
|
|
193
|
+
callback: item
|
|
194
|
+
};
|
|
195
|
+
}
|
|
219
196
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
(cmd.prefix != null ? t.open + cmd.prefix + t.close + ':' : '') +
|
|
224
|
-
cmd.text
|
|
225
|
-
|
|
226
|
-
len = ((cmd.prefix != null ? cmd.prefix + ':' : '') + cmd.text).length
|
|
227
|
-
|
|
228
|
-
const options = {
|
|
229
|
-
screen: this.screen,
|
|
230
|
-
top: 0,
|
|
231
|
-
left: drawn + 1,
|
|
232
|
-
height: 1,
|
|
233
|
-
content: title,
|
|
234
|
-
width: len + 2,
|
|
235
|
-
align: 'center',
|
|
236
|
-
autoFocus: false,
|
|
237
|
-
tags: true,
|
|
238
|
-
mouse: true,
|
|
239
|
-
style: helpers.merge({}, this.style.item),
|
|
240
|
-
noOverflow: true
|
|
241
|
-
}
|
|
197
|
+
if (cmd.keys && cmd.keys[0]) {
|
|
198
|
+
cmd.prefix = cmd.keys[0];
|
|
199
|
+
}
|
|
242
200
|
|
|
243
|
-
|
|
244
|
-
options.top += this.itop
|
|
245
|
-
options.left += this.ileft
|
|
246
|
-
}
|
|
201
|
+
var t = helpers.generateTags(this.style.prefix || { fg: 'lightblack' });
|
|
247
202
|
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
203
|
+
title = (cmd.prefix != null ? t.open + cmd.prefix + t.close + ':' : '') + cmd.text;
|
|
204
|
+
|
|
205
|
+
len = ((cmd.prefix != null ? cmd.prefix + ':' : '') + cmd.text).length;
|
|
206
|
+
|
|
207
|
+
var options = {
|
|
208
|
+
screen: this.screen,
|
|
209
|
+
top: 0,
|
|
210
|
+
left: drawn + 1,
|
|
211
|
+
height: 1,
|
|
212
|
+
content: title,
|
|
213
|
+
width: len + 2,
|
|
214
|
+
align: 'center',
|
|
215
|
+
autoFocus: false,
|
|
216
|
+
tags: true,
|
|
217
|
+
mouse: true,
|
|
218
|
+
style: helpers.merge({}, this.style.item),
|
|
219
|
+
noOverflow: true
|
|
220
|
+
};
|
|
221
|
+
|
|
222
|
+
if (!this.screen.autoPadding) {
|
|
223
|
+
options.top += this.itop;
|
|
224
|
+
options.left += this.ileft;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
['bg', 'fg', 'bold', 'underline',
|
|
228
|
+
'blink', 'inverse', 'invisible'].forEach(function(name) {
|
|
229
|
+
options.style[name] = function() {
|
|
230
|
+
var attr = self.items[self.selected] === el
|
|
231
|
+
? self.style.selected[name]
|
|
232
|
+
: self.style.item[name];
|
|
233
|
+
if (typeof attr === 'function') attr = attr(el);
|
|
234
|
+
return attr;
|
|
235
|
+
};
|
|
236
|
+
});
|
|
237
|
+
|
|
238
|
+
var el = new Box(options);
|
|
239
|
+
|
|
240
|
+
this._[cmd.text] = el;
|
|
241
|
+
cmd.element = el;
|
|
242
|
+
el._.cmd = cmd;
|
|
243
|
+
|
|
244
|
+
this.ritems.push(cmd.text);
|
|
245
|
+
this.items.push(el);
|
|
246
|
+
this.commands.push(cmd);
|
|
247
|
+
this.append(el);
|
|
248
|
+
|
|
249
|
+
if (cmd.callback) {
|
|
250
|
+
if (cmd.keys) {
|
|
251
|
+
this.screen.key(cmd.keys, function() {
|
|
252
|
+
self.emit('action', el, self.selected);
|
|
253
|
+
self.emit('select', el, self.selected);
|
|
254
|
+
if (el._.cmd.callback) {
|
|
255
|
+
el._.cmd.callback();
|
|
291
256
|
}
|
|
292
|
-
|
|
257
|
+
self.select(el);
|
|
258
|
+
self.screen.render();
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
293
262
|
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
263
|
+
if (this.items.length === 1) {
|
|
264
|
+
this.select(0);
|
|
265
|
+
}
|
|
297
266
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
self.select(el)
|
|
307
|
-
self.screen.render()
|
|
308
|
-
})
|
|
267
|
+
// XXX May be affected by new element.options.mouse option.
|
|
268
|
+
if (this.mouse) {
|
|
269
|
+
el.on('click', function() {
|
|
270
|
+
self.emit('action', el, self.selected);
|
|
271
|
+
self.emit('select', el, self.selected);
|
|
272
|
+
if (el._.cmd.callback) {
|
|
273
|
+
el._.cmd.callback();
|
|
309
274
|
}
|
|
275
|
+
self.select(el);
|
|
276
|
+
self.screen.render();
|
|
277
|
+
});
|
|
278
|
+
}
|
|
310
279
|
|
|
311
|
-
|
|
312
|
-
|
|
280
|
+
this.emit('add item');
|
|
281
|
+
};
|
|
313
282
|
|
|
314
|
-
Listbar.prototype.render = function
|
|
315
|
-
|
|
316
|
-
drawn = 0
|
|
283
|
+
Listbar.prototype.render = function() {
|
|
284
|
+
var self = this
|
|
285
|
+
, drawn = 0;
|
|
317
286
|
|
|
318
287
|
if (!this.screen.autoPadding) {
|
|
319
|
-
drawn += this.ileft
|
|
288
|
+
drawn += this.ileft;
|
|
320
289
|
}
|
|
321
290
|
|
|
322
|
-
this.items.forEach(function
|
|
291
|
+
this.items.forEach(function(el, i) {
|
|
323
292
|
if (i < self.leftBase) {
|
|
324
|
-
el.hide()
|
|
293
|
+
el.hide();
|
|
325
294
|
} else {
|
|
326
|
-
el.rleft = drawn + 1
|
|
327
|
-
drawn += el.width + 2
|
|
328
|
-
el.show()
|
|
295
|
+
el.rleft = drawn + 1;
|
|
296
|
+
drawn += el.width + 2;
|
|
297
|
+
el.show();
|
|
329
298
|
}
|
|
330
|
-
})
|
|
299
|
+
});
|
|
331
300
|
|
|
332
|
-
return this._render()
|
|
333
|
-
}
|
|
301
|
+
return this._render();
|
|
302
|
+
};
|
|
334
303
|
|
|
335
|
-
Listbar.prototype.select = function
|
|
304
|
+
Listbar.prototype.select = function(offset) {
|
|
336
305
|
if (typeof offset !== 'number') {
|
|
337
|
-
offset = this.items.indexOf(offset)
|
|
306
|
+
offset = this.items.indexOf(offset);
|
|
338
307
|
}
|
|
339
308
|
|
|
340
309
|
if (offset < 0) {
|
|
341
|
-
offset = 0
|
|
310
|
+
offset = 0;
|
|
342
311
|
} else if (offset >= this.items.length) {
|
|
343
|
-
offset = this.items.length - 1
|
|
312
|
+
offset = this.items.length - 1;
|
|
344
313
|
}
|
|
345
314
|
|
|
346
315
|
if (!this.parent) {
|
|
347
|
-
this.emit('select item', this.items[offset], offset)
|
|
348
|
-
return
|
|
316
|
+
this.emit('select item', this.items[offset], offset);
|
|
317
|
+
return;
|
|
349
318
|
}
|
|
350
319
|
|
|
351
|
-
|
|
352
|
-
if (!lpos)
|
|
353
|
-
return
|
|
354
|
-
}
|
|
320
|
+
var lpos = this._getCoords();
|
|
321
|
+
if (!lpos) return;
|
|
355
322
|
|
|
356
|
-
|
|
357
|
-
width = lpos.xl - lpos.xi - this.iwidth
|
|
358
|
-
drawn = 0
|
|
359
|
-
visible = 0
|
|
360
|
-
el
|
|
323
|
+
var self = this
|
|
324
|
+
, width = (lpos.xl - lpos.xi) - this.iwidth
|
|
325
|
+
, drawn = 0
|
|
326
|
+
, visible = 0
|
|
327
|
+
, el;
|
|
361
328
|
|
|
362
|
-
el = this.items[offset]
|
|
363
|
-
if (!el)
|
|
364
|
-
return
|
|
365
|
-
}
|
|
329
|
+
el = this.items[offset];
|
|
330
|
+
if (!el) return;
|
|
366
331
|
|
|
367
|
-
this.items.forEach(function
|
|
368
|
-
if (i < self.leftBase)
|
|
369
|
-
return
|
|
370
|
-
}
|
|
332
|
+
this.items.forEach(function(el, i) {
|
|
333
|
+
if (i < self.leftBase) return;
|
|
371
334
|
|
|
372
|
-
|
|
373
|
-
if (!lpos)
|
|
374
|
-
return
|
|
375
|
-
}
|
|
335
|
+
var lpos = el._getCoords();
|
|
336
|
+
if (!lpos) return;
|
|
376
337
|
|
|
377
|
-
if (lpos.xl - lpos.xi <= 0)
|
|
378
|
-
return
|
|
379
|
-
}
|
|
338
|
+
if (lpos.xl - lpos.xi <= 0) return;
|
|
380
339
|
|
|
381
|
-
drawn += lpos.xl - lpos.xi + 2
|
|
340
|
+
drawn += (lpos.xl - lpos.xi) + 2;
|
|
382
341
|
|
|
383
|
-
if (drawn <= width)
|
|
384
|
-
|
|
385
|
-
}
|
|
386
|
-
})
|
|
342
|
+
if (drawn <= width) visible++;
|
|
343
|
+
});
|
|
387
344
|
|
|
388
|
-
|
|
345
|
+
var diff = offset - (this.leftBase + this.leftOffset);
|
|
389
346
|
if (offset > this.leftBase + this.leftOffset) {
|
|
390
347
|
if (offset > this.leftBase + visible - 1) {
|
|
391
|
-
this.leftOffset = 0
|
|
392
|
-
this.leftBase = offset
|
|
348
|
+
this.leftOffset = 0;
|
|
349
|
+
this.leftBase = offset;
|
|
393
350
|
} else {
|
|
394
|
-
this.leftOffset += diff
|
|
351
|
+
this.leftOffset += diff;
|
|
395
352
|
}
|
|
396
353
|
} else if (offset < this.leftBase + this.leftOffset) {
|
|
397
|
-
diff = -diff
|
|
354
|
+
diff = -diff;
|
|
398
355
|
if (offset < this.leftBase) {
|
|
399
|
-
this.leftOffset = 0
|
|
400
|
-
this.leftBase = offset
|
|
356
|
+
this.leftOffset = 0;
|
|
357
|
+
this.leftBase = offset;
|
|
401
358
|
} else {
|
|
402
|
-
this.leftOffset -= diff
|
|
359
|
+
this.leftOffset -= diff;
|
|
403
360
|
}
|
|
404
361
|
}
|
|
405
362
|
|
|
406
363
|
// XXX Move `action` and `select` events here.
|
|
407
|
-
this.emit('select item', el, offset)
|
|
408
|
-
}
|
|
364
|
+
this.emit('select item', el, offset);
|
|
365
|
+
};
|
|
409
366
|
|
|
410
|
-
Listbar.prototype.removeItem = function
|
|
411
|
-
|
|
367
|
+
Listbar.prototype.removeItem = function(child) {
|
|
368
|
+
var i = typeof child !== 'number'
|
|
369
|
+
? this.items.indexOf(child)
|
|
370
|
+
: child;
|
|
412
371
|
|
|
413
372
|
if (~i && this.items[i]) {
|
|
414
|
-
child = this.items.splice(i, 1)[0]
|
|
415
|
-
this.ritems.splice(i, 1)
|
|
416
|
-
this.commands.splice(i, 1)
|
|
417
|
-
this.remove(child)
|
|
373
|
+
child = this.items.splice(i, 1)[0];
|
|
374
|
+
this.ritems.splice(i, 1);
|
|
375
|
+
this.commands.splice(i, 1);
|
|
376
|
+
this.remove(child);
|
|
418
377
|
if (i === this.selected) {
|
|
419
|
-
this.select(i - 1)
|
|
378
|
+
this.select(i - 1);
|
|
420
379
|
}
|
|
421
380
|
}
|
|
422
381
|
|
|
423
|
-
this.emit('remove item')
|
|
424
|
-
}
|
|
382
|
+
this.emit('remove item');
|
|
383
|
+
};
|
|
425
384
|
|
|
426
|
-
Listbar.prototype.move = function
|
|
427
|
-
this.select(this.selected + offset)
|
|
428
|
-
}
|
|
385
|
+
Listbar.prototype.move = function(offset) {
|
|
386
|
+
this.select(this.selected + offset);
|
|
387
|
+
};
|
|
429
388
|
|
|
430
|
-
Listbar.prototype.moveLeft = function
|
|
431
|
-
this.move(-(offset || 1))
|
|
432
|
-
}
|
|
389
|
+
Listbar.prototype.moveLeft = function(offset) {
|
|
390
|
+
this.move(-(offset || 1));
|
|
391
|
+
};
|
|
433
392
|
|
|
434
|
-
Listbar.prototype.moveRight = function
|
|
435
|
-
this.move(offset || 1)
|
|
436
|
-
}
|
|
393
|
+
Listbar.prototype.moveRight = function(offset) {
|
|
394
|
+
this.move(offset || 1);
|
|
395
|
+
};
|
|
437
396
|
|
|
438
|
-
Listbar.prototype.selectTab = function
|
|
439
|
-
|
|
397
|
+
Listbar.prototype.selectTab = function(index) {
|
|
398
|
+
var item = this.items[index];
|
|
440
399
|
if (item) {
|
|
441
400
|
if (item._.cmd.callback) {
|
|
442
|
-
item._.cmd.callback()
|
|
401
|
+
item._.cmd.callback();
|
|
443
402
|
}
|
|
444
|
-
this.select(index)
|
|
445
|
-
this.screen.render()
|
|
403
|
+
this.select(index);
|
|
404
|
+
this.screen.render();
|
|
446
405
|
}
|
|
447
|
-
this.emit('select tab', item, index)
|
|
448
|
-
}
|
|
406
|
+
this.emit('select tab', item, index);
|
|
407
|
+
};
|
|
449
408
|
|
|
450
409
|
/**
|
|
451
410
|
* Expose
|
|
452
411
|
*/
|
|
453
412
|
|
|
454
|
-
module.exports = Listbar
|
|
413
|
+
module.exports = Listbar;
|