@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
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* https://github.com/chjj/blessed
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
var widget = exports;
|
|
10
10
|
|
|
11
11
|
widget.classes = [
|
|
12
12
|
'Node',
|
|
@@ -43,20 +43,20 @@ widget.classes = [
|
|
|
43
43
|
'OverlayImage',
|
|
44
44
|
'Video',
|
|
45
45
|
'Layout'
|
|
46
|
-
]
|
|
46
|
+
];
|
|
47
47
|
|
|
48
|
-
widget.classes.forEach(function
|
|
49
|
-
|
|
50
|
-
widget[name] = widget[file] = require('./widgets/' + file)
|
|
51
|
-
})
|
|
48
|
+
widget.classes.forEach(function(name) {
|
|
49
|
+
var file = name.toLowerCase();
|
|
50
|
+
widget[name] = widget[file] = require('./widgets/' + file);
|
|
51
|
+
});
|
|
52
52
|
|
|
53
53
|
widget.aliases = {
|
|
54
|
-
ListBar: 'Listbar',
|
|
55
|
-
PNG: 'ANSIImage'
|
|
56
|
-
}
|
|
54
|
+
'ListBar': 'Listbar',
|
|
55
|
+
'PNG': 'ANSIImage'
|
|
56
|
+
};
|
|
57
57
|
|
|
58
|
-
Object.keys(widget.aliases).forEach(function
|
|
59
|
-
|
|
60
|
-
widget[key] = widget[name]
|
|
61
|
-
widget[key.toLowerCase()] = widget[name]
|
|
62
|
-
})
|
|
58
|
+
Object.keys(widget.aliases).forEach(function(key) {
|
|
59
|
+
var name = widget.aliases[key];
|
|
60
|
+
widget[key] = widget[name];
|
|
61
|
+
widget[key.toLowerCase()] = widget[name];
|
|
62
|
+
});
|
|
@@ -10,91 +10,93 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var cp = require('child_process');
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
var colors = require('../colors');
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
var Node = require('./node');
|
|
18
|
+
var Box = require('./box');
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
var tng = require('../../vendor/tng');
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* ANSIImage
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
26
|
function ANSIImage(options) {
|
|
27
|
-
|
|
27
|
+
var self = this;
|
|
28
28
|
|
|
29
29
|
if (!(this instanceof Node)) {
|
|
30
|
-
return new ANSIImage(options)
|
|
30
|
+
return new ANSIImage(options);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
options = options || {}
|
|
34
|
-
options.shrink = true
|
|
33
|
+
options = options || {};
|
|
34
|
+
options.shrink = true;
|
|
35
35
|
|
|
36
|
-
Box.call(this, options)
|
|
36
|
+
Box.call(this, options);
|
|
37
37
|
|
|
38
|
-
this.scale = this.options.scale || 1.0
|
|
39
|
-
this.options.animate = this.options.animate !== false
|
|
40
|
-
this._noFill = true
|
|
38
|
+
this.scale = this.options.scale || 1.0;
|
|
39
|
+
this.options.animate = this.options.animate !== false;
|
|
40
|
+
this._noFill = true;
|
|
41
41
|
|
|
42
42
|
if (this.options.file) {
|
|
43
|
-
this.setImage(this.options.file)
|
|
43
|
+
this.setImage(this.options.file);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
this.screen.on('prerender', function
|
|
47
|
-
|
|
48
|
-
if (!lpos)
|
|
49
|
-
return
|
|
50
|
-
}
|
|
46
|
+
this.screen.on('prerender', function() {
|
|
47
|
+
var lpos = self.lpos;
|
|
48
|
+
if (!lpos) return;
|
|
51
49
|
// prevent image from blending with itself if there are alpha channels
|
|
52
|
-
self.screen.clearRegion(lpos.xi, lpos.xl, lpos.yi, lpos.yl)
|
|
53
|
-
})
|
|
50
|
+
self.screen.clearRegion(lpos.xi, lpos.xl, lpos.yi, lpos.yl);
|
|
51
|
+
});
|
|
54
52
|
|
|
55
|
-
this.on('destroy', function
|
|
56
|
-
self.stop()
|
|
57
|
-
})
|
|
53
|
+
this.on('destroy', function() {
|
|
54
|
+
self.stop();
|
|
55
|
+
});
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
Object.setPrototypeOf(ANSIImage.prototype, Box.prototype)
|
|
58
|
+
Object.setPrototypeOf(ANSIImage.prototype, Box.prototype);
|
|
61
59
|
|
|
62
|
-
ANSIImage.prototype.type = 'ansiimage'
|
|
60
|
+
ANSIImage.prototype.type = 'ansiimage';
|
|
63
61
|
|
|
64
|
-
ANSIImage.curl = function
|
|
62
|
+
ANSIImage.curl = function(url) {
|
|
65
63
|
try {
|
|
66
|
-
return cp.execFileSync('curl',
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} catch (e) {
|
|
64
|
+
return cp.execFileSync('curl',
|
|
65
|
+
['-s', '-A', '', url],
|
|
66
|
+
{ stdio: ['ignore', 'pipe', 'ignore'] });
|
|
67
|
+
} catch (e) {
|
|
68
|
+
;
|
|
69
|
+
}
|
|
70
70
|
try {
|
|
71
|
-
return cp.execFileSync('wget',
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} catch (e) {
|
|
75
|
-
|
|
76
|
-
}
|
|
71
|
+
return cp.execFileSync('wget',
|
|
72
|
+
['-U', '', '-O', '-', url],
|
|
73
|
+
{ stdio: ['ignore', 'pipe', 'ignore'] });
|
|
74
|
+
} catch (e) {
|
|
75
|
+
;
|
|
76
|
+
}
|
|
77
|
+
throw new Error('curl or wget failed.');
|
|
78
|
+
};
|
|
77
79
|
|
|
78
|
-
ANSIImage.prototype.setImage = function
|
|
79
|
-
this.file = typeof file === 'string' ? file : null
|
|
80
|
+
ANSIImage.prototype.setImage = function(file) {
|
|
81
|
+
this.file = typeof file === 'string' ? file : null;
|
|
80
82
|
|
|
81
83
|
if (/^https?:/.test(file)) {
|
|
82
|
-
file = ANSIImage.curl(file)
|
|
84
|
+
file = ANSIImage.curl(file);
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
var width = this.position.width;
|
|
88
|
+
var height = this.position.height;
|
|
87
89
|
|
|
88
90
|
if (width != null) {
|
|
89
|
-
width = this.width
|
|
91
|
+
width = this.width;
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
if (height != null) {
|
|
93
|
-
height = this.height
|
|
95
|
+
height = this.height;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
try {
|
|
97
|
-
this.setContent('')
|
|
99
|
+
this.setContent('');
|
|
98
100
|
|
|
99
101
|
this.img = tng(file, {
|
|
100
102
|
colors: colors,
|
|
@@ -104,72 +106,64 @@ ANSIImage.prototype.setImage = function (file) {
|
|
|
104
106
|
ascii: this.options.ascii,
|
|
105
107
|
speed: this.options.speed,
|
|
106
108
|
filename: this.file
|
|
107
|
-
})
|
|
109
|
+
});
|
|
108
110
|
|
|
109
111
|
if (width == null || height == null) {
|
|
110
|
-
this.width = this.img.cellmap[0].length
|
|
111
|
-
this.height = this.img.cellmap.length
|
|
112
|
+
this.width = this.img.cellmap[0].length;
|
|
113
|
+
this.height = this.img.cellmap.length;
|
|
112
114
|
}
|
|
113
115
|
|
|
114
116
|
if (this.img.frames && this.options.animate) {
|
|
115
|
-
this.play()
|
|
117
|
+
this.play();
|
|
116
118
|
} else {
|
|
117
|
-
this.cellmap = this.img.cellmap
|
|
119
|
+
this.cellmap = this.img.cellmap;
|
|
118
120
|
}
|
|
119
121
|
} catch (e) {
|
|
120
|
-
this.setContent('Image Error: ' + e.message)
|
|
121
|
-
this.img = null
|
|
122
|
-
this.cellmap = null
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
ANSIImage.prototype.play = function () {
|
|
127
|
-
const self = this
|
|
128
|
-
if (!this.img) {
|
|
129
|
-
return
|
|
130
|
-
}
|
|
131
|
-
return this.img.play(function (bmp, cellmap) {
|
|
132
|
-
self.cellmap = cellmap
|
|
133
|
-
self.screen.render()
|
|
134
|
-
})
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
ANSIImage.prototype.pause = function () {
|
|
138
|
-
if (!this.img) {
|
|
139
|
-
return
|
|
140
|
-
}
|
|
141
|
-
return this.img.pause()
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
ANSIImage.prototype.stop = function () {
|
|
145
|
-
if (!this.img) {
|
|
146
|
-
return
|
|
147
|
-
}
|
|
148
|
-
return this.img.stop()
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
ANSIImage.prototype.clearImage = function () {
|
|
152
|
-
this.stop()
|
|
153
|
-
this.setContent('')
|
|
154
|
-
this.img = null
|
|
155
|
-
this.cellmap = null
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
ANSIImage.prototype.render = function () {
|
|
159
|
-
const coords = this._render()
|
|
160
|
-
if (!coords) {
|
|
161
|
-
return
|
|
122
|
+
this.setContent('Image Error: ' + e.message);
|
|
123
|
+
this.img = null;
|
|
124
|
+
this.cellmap = null;
|
|
162
125
|
}
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
ANSIImage.prototype.play = function() {
|
|
129
|
+
var self = this;
|
|
130
|
+
if (!this.img) return;
|
|
131
|
+
return this.img.play(function(bmp, cellmap) {
|
|
132
|
+
self.cellmap = cellmap;
|
|
133
|
+
self.screen.render();
|
|
134
|
+
});
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
ANSIImage.prototype.pause = function() {
|
|
138
|
+
if (!this.img) return;
|
|
139
|
+
return this.img.pause();
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
ANSIImage.prototype.stop = function() {
|
|
143
|
+
if (!this.img) return;
|
|
144
|
+
return this.img.stop();
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
ANSIImage.prototype.clearImage = function() {
|
|
148
|
+
this.stop();
|
|
149
|
+
this.setContent('');
|
|
150
|
+
this.img = null;
|
|
151
|
+
this.cellmap = null;
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
ANSIImage.prototype.render = function() {
|
|
155
|
+
var coords = this._render();
|
|
156
|
+
if (!coords) return;
|
|
163
157
|
|
|
164
158
|
if (this.img && this.cellmap) {
|
|
165
|
-
this.img.renderElement(this.cellmap, this)
|
|
159
|
+
this.img.renderElement(this.cellmap, this);
|
|
166
160
|
}
|
|
167
161
|
|
|
168
|
-
return coords
|
|
169
|
-
}
|
|
162
|
+
return coords;
|
|
163
|
+
};
|
|
170
164
|
|
|
171
165
|
/**
|
|
172
166
|
* Expose
|
|
173
167
|
*/
|
|
174
168
|
|
|
175
|
-
module.exports = ANSIImage
|
|
169
|
+
module.exports = ANSIImage;
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var fs = require('fs');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var Node = require('./node');
|
|
16
|
+
var Box = require('./box');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* BigText
|
|
@@ -21,152 +21,141 @@ const Box = require('./box')
|
|
|
21
21
|
|
|
22
22
|
function BigText(options) {
|
|
23
23
|
if (!(this instanceof Node)) {
|
|
24
|
-
return new BigText(options)
|
|
24
|
+
return new BigText(options);
|
|
25
25
|
}
|
|
26
|
-
options = options || {}
|
|
27
|
-
options.font = options.font
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
this.
|
|
32
|
-
this.
|
|
33
|
-
this.
|
|
34
|
-
|
|
26
|
+
options = options || {};
|
|
27
|
+
options.font = options.font
|
|
28
|
+
|| __dirname + '/../../usr/fonts/ter-u14n.json';
|
|
29
|
+
options.fontBold = options.font
|
|
30
|
+
|| __dirname + '/../../usr/fonts/ter-u14b.json';
|
|
31
|
+
this.fch = options.fch;
|
|
32
|
+
this.ratio = {};
|
|
33
|
+
this.font = this.loadFont(options.font);
|
|
34
|
+
this.fontBold = this.loadFont(options.font);
|
|
35
|
+
Box.call(this, options);
|
|
35
36
|
if (this.style.bold) {
|
|
36
|
-
this.font = this.fontBold
|
|
37
|
+
this.font = this.fontBold;
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
40
|
-
Object.setPrototypeOf(BigText.prototype, Box.prototype)
|
|
41
|
+
Object.setPrototypeOf(BigText.prototype, Box.prototype);
|
|
41
42
|
|
|
42
|
-
BigText.prototype.type = 'bigtext'
|
|
43
|
+
BigText.prototype.type = 'bigtext';
|
|
43
44
|
|
|
44
|
-
BigText.prototype.loadFont = function
|
|
45
|
-
|
|
46
|
-
data
|
|
47
|
-
font
|
|
45
|
+
BigText.prototype.loadFont = function(filename) {
|
|
46
|
+
var self = this
|
|
47
|
+
, data
|
|
48
|
+
, font;
|
|
48
49
|
|
|
49
|
-
data = JSON.parse(fs.readFileSync(filename, 'utf8'))
|
|
50
|
+
data = JSON.parse(fs.readFileSync(filename, 'utf8'));
|
|
50
51
|
|
|
51
|
-
this.ratio.width = data.width
|
|
52
|
-
this.ratio.height = data.height
|
|
52
|
+
this.ratio.width = data.width;
|
|
53
|
+
this.ratio.height = data.height;
|
|
53
54
|
|
|
54
55
|
function convertLetter(ch, lines) {
|
|
55
|
-
|
|
56
|
+
var line, i;
|
|
56
57
|
|
|
57
58
|
while (lines.length > self.ratio.height) {
|
|
58
|
-
lines.shift()
|
|
59
|
-
lines.pop()
|
|
59
|
+
lines.shift();
|
|
60
|
+
lines.pop();
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
lines = lines.map(function
|
|
63
|
-
|
|
64
|
-
chs = chs.map(function
|
|
65
|
-
return ch === ' ' ? 0 : 1
|
|
66
|
-
})
|
|
63
|
+
lines = lines.map(function(line) {
|
|
64
|
+
var chs = line.split('');
|
|
65
|
+
chs = chs.map(function(ch) {
|
|
66
|
+
return ch === ' ' ? 0 : 1;
|
|
67
|
+
});
|
|
67
68
|
while (chs.length < self.ratio.width) {
|
|
68
|
-
chs.push(0)
|
|
69
|
+
chs.push(0);
|
|
69
70
|
}
|
|
70
|
-
return chs
|
|
71
|
-
})
|
|
71
|
+
return chs;
|
|
72
|
+
});
|
|
72
73
|
|
|
73
74
|
while (lines.length < self.ratio.height) {
|
|
74
|
-
line = []
|
|
75
|
+
line = [];
|
|
75
76
|
for (i = 0; i < self.ratio.width; i++) {
|
|
76
|
-
line.push(0)
|
|
77
|
+
line.push(0);
|
|
77
78
|
}
|
|
78
|
-
lines.push(line)
|
|
79
|
+
lines.push(line);
|
|
79
80
|
}
|
|
80
81
|
|
|
81
|
-
return lines
|
|
82
|
+
return lines;
|
|
82
83
|
}
|
|
83
84
|
|
|
84
|
-
font = Object.keys(data.glyphs).reduce(function
|
|
85
|
-
|
|
86
|
-
out[ch] = convertLetter(ch, lines)
|
|
87
|
-
return out
|
|
88
|
-
}, {})
|
|
85
|
+
font = Object.keys(data.glyphs).reduce(function(out, ch) {
|
|
86
|
+
var lines = data.glyphs[ch].map;
|
|
87
|
+
out[ch] = convertLetter(ch, lines);
|
|
88
|
+
return out;
|
|
89
|
+
}, {});
|
|
89
90
|
|
|
90
|
-
delete font[' ']
|
|
91
|
+
delete font[' '];
|
|
91
92
|
|
|
92
|
-
return font
|
|
93
|
-
}
|
|
93
|
+
return font;
|
|
94
|
+
};
|
|
94
95
|
|
|
95
|
-
BigText.prototype.setContent = function
|
|
96
|
-
this.content = ''
|
|
97
|
-
this.text = content || ''
|
|
98
|
-
}
|
|
96
|
+
BigText.prototype.setContent = function(content) {
|
|
97
|
+
this.content = '';
|
|
98
|
+
this.text = content || '';
|
|
99
|
+
};
|
|
99
100
|
|
|
100
|
-
BigText.prototype.render = function
|
|
101
|
+
BigText.prototype.render = function() {
|
|
101
102
|
if (this.position.width == null || this._shrinkWidth) {
|
|
102
103
|
// if (this.width - this.iwidth < this.ratio.width * this.text.length + 1) {
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
this.position.width = this.ratio.width * this.text.length + 1;
|
|
105
|
+
this._shrinkWidth = true;
|
|
105
106
|
// }
|
|
106
107
|
}
|
|
107
108
|
if (this.position.height == null || this._shrinkHeight) {
|
|
108
109
|
// if (this.height - this.iheight < this.ratio.height + 0) {
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
this.position.height = this.ratio.height + 0;
|
|
111
|
+
this._shrinkHeight = true;
|
|
111
112
|
// }
|
|
112
113
|
}
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
if (!coords)
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
if (!
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
if (!lines[y]) {
|
|
142
|
-
continue
|
|
143
|
-
}
|
|
144
|
-
const mline = map[y - top]
|
|
145
|
-
if (!mline) {
|
|
146
|
-
continue
|
|
147
|
-
}
|
|
148
|
-
for (let mx = 0; mx < this.ratio.width; mx++) {
|
|
149
|
-
const mcell = mline[mx]
|
|
150
|
-
if (mcell == null) {
|
|
151
|
-
break
|
|
152
|
-
}
|
|
115
|
+
var coords = this._render();
|
|
116
|
+
if (!coords) return;
|
|
117
|
+
|
|
118
|
+
var lines = this.screen.lines
|
|
119
|
+
, left = coords.xi + this.ileft
|
|
120
|
+
, top = coords.yi + this.itop
|
|
121
|
+
, right = coords.xl - this.iright
|
|
122
|
+
, bottom = coords.yl - this.ibottom;
|
|
123
|
+
|
|
124
|
+
var dattr = this.sattr(this.style)
|
|
125
|
+
, bg = dattr & 0x1ff
|
|
126
|
+
, fg = (dattr >> 9) & 0x1ff
|
|
127
|
+
, flags = (dattr >> 18) & 0x1ff
|
|
128
|
+
, attr = (flags << 18) | (bg << 9) | fg;
|
|
129
|
+
|
|
130
|
+
for (var x = left, i = 0; x < right; x += this.ratio.width, i++) {
|
|
131
|
+
var ch = this.text[i];
|
|
132
|
+
if (!ch) break;
|
|
133
|
+
var map = this.font[ch];
|
|
134
|
+
if (!map) continue;
|
|
135
|
+
for (var y = top; y < Math.min(bottom, top + this.ratio.height); y++) {
|
|
136
|
+
if (!lines[y]) continue;
|
|
137
|
+
var mline = map[y - top];
|
|
138
|
+
if (!mline) continue;
|
|
139
|
+
for (var mx = 0; mx < this.ratio.width; mx++) {
|
|
140
|
+
var mcell = mline[mx];
|
|
141
|
+
if (mcell == null) break;
|
|
153
142
|
if (this.fch && this.fch !== ' ') {
|
|
154
|
-
lines[y][x + mx][0] = dattr
|
|
155
|
-
lines[y][x + mx][1] = mcell === 1 ? this.fch : this.ch
|
|
143
|
+
lines[y][x + mx][0] = dattr;
|
|
144
|
+
lines[y][x + mx][1] = mcell === 1 ? this.fch : this.ch;
|
|
156
145
|
} else {
|
|
157
|
-
lines[y][x + mx][0] = mcell === 1 ? attr : dattr
|
|
158
|
-
lines[y][x + mx][1] = mcell === 1 ? ' ' : this.ch
|
|
146
|
+
lines[y][x + mx][0] = mcell === 1 ? attr : dattr;
|
|
147
|
+
lines[y][x + mx][1] = mcell === 1 ? ' ' : this.ch;
|
|
159
148
|
}
|
|
160
149
|
}
|
|
161
|
-
lines[y].dirty = true
|
|
150
|
+
lines[y].dirty = true;
|
|
162
151
|
}
|
|
163
152
|
}
|
|
164
153
|
|
|
165
|
-
return coords
|
|
166
|
-
}
|
|
154
|
+
return coords;
|
|
155
|
+
};
|
|
167
156
|
|
|
168
157
|
/**
|
|
169
158
|
* Expose
|
|
170
159
|
*/
|
|
171
160
|
|
|
172
|
-
module.exports = BigText
|
|
161
|
+
module.exports = BigText;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Element = require('./element');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Box
|
|
@@ -19,18 +19,18 @@ const Element = require('./element')
|
|
|
19
19
|
|
|
20
20
|
function Box(options) {
|
|
21
21
|
if (!(this instanceof Node)) {
|
|
22
|
-
return new Box(options)
|
|
22
|
+
return new Box(options);
|
|
23
23
|
}
|
|
24
|
-
options = options || {}
|
|
25
|
-
Element.call(this, options)
|
|
24
|
+
options = options || {};
|
|
25
|
+
Element.call(this, options);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
Object.setPrototypeOf(Box.prototype, Element.prototype)
|
|
28
|
+
Object.setPrototypeOf(Box.prototype, Element.prototype);
|
|
29
29
|
|
|
30
|
-
Box.prototype.type = 'box'
|
|
30
|
+
Box.prototype.type = 'box';
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Expose
|
|
34
34
|
*/
|
|
35
35
|
|
|
36
|
-
module.exports = Box
|
|
36
|
+
module.exports = Box;
|
|
@@ -10,55 +10,55 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Input = require('./input');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Button
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
function Button(options) {
|
|
21
|
-
|
|
21
|
+
var self = this;
|
|
22
22
|
|
|
23
23
|
if (!(this instanceof Node)) {
|
|
24
|
-
return new Button(options)
|
|
24
|
+
return new Button(options);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
options = options || {}
|
|
27
|
+
options = options || {};
|
|
28
28
|
|
|
29
29
|
if (options.autoFocus == null) {
|
|
30
|
-
options.autoFocus = false
|
|
30
|
+
options.autoFocus = false;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
Input.call(this, options)
|
|
33
|
+
Input.call(this, options);
|
|
34
34
|
|
|
35
|
-
this.on('keypress', function
|
|
35
|
+
this.on('keypress', function(ch, key) {
|
|
36
36
|
if (key.name === 'enter' || key.name === 'space') {
|
|
37
|
-
return self.press()
|
|
37
|
+
return self.press();
|
|
38
38
|
}
|
|
39
|
-
})
|
|
39
|
+
});
|
|
40
40
|
|
|
41
41
|
if (this.options.mouse) {
|
|
42
|
-
this.on('click', function
|
|
43
|
-
return self.press()
|
|
44
|
-
})
|
|
42
|
+
this.on('click', function() {
|
|
43
|
+
return self.press();
|
|
44
|
+
});
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
Object.setPrototypeOf(Button.prototype, Input.prototype)
|
|
48
|
+
Object.setPrototypeOf(Button.prototype, Input.prototype);
|
|
49
49
|
|
|
50
|
-
Button.prototype.type = 'button'
|
|
50
|
+
Button.prototype.type = 'button';
|
|
51
51
|
|
|
52
|
-
Button.prototype.press = function
|
|
53
|
-
this.focus()
|
|
54
|
-
this.value = true
|
|
55
|
-
|
|
56
|
-
delete this.value
|
|
57
|
-
return result
|
|
58
|
-
}
|
|
52
|
+
Button.prototype.press = function() {
|
|
53
|
+
this.focus();
|
|
54
|
+
this.value = true;
|
|
55
|
+
var result = this.emit('press');
|
|
56
|
+
delete this.value;
|
|
57
|
+
return result;
|
|
58
|
+
};
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Expose
|
|
62
62
|
*/
|
|
63
63
|
|
|
64
|
-
module.exports = Button
|
|
64
|
+
module.exports = Button;
|