@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,8 +10,8 @@
|
|
|
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
|
* Message / Error
|
|
@@ -19,34 +19,29 @@ const Box = require('./box')
|
|
|
19
19
|
|
|
20
20
|
function Message(options) {
|
|
21
21
|
if (!(this instanceof Node)) {
|
|
22
|
-
return new Message(options)
|
|
22
|
+
return new Message(options);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
options = options || {}
|
|
26
|
-
options.tags = true
|
|
25
|
+
options = options || {};
|
|
26
|
+
options.tags = true;
|
|
27
27
|
|
|
28
|
-
Box.call(this, options)
|
|
28
|
+
Box.call(this, options);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
Object.setPrototypeOf(Message.prototype, Box.prototype)
|
|
31
|
+
Object.setPrototypeOf(Message.prototype, Box.prototype);
|
|
32
32
|
|
|
33
|
-
Message.prototype.type = 'message'
|
|
33
|
+
Message.prototype.type = 'message';
|
|
34
34
|
|
|
35
|
-
Message.prototype.log =
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
callback
|
|
39
|
-
) {
|
|
40
|
-
const self = this
|
|
35
|
+
Message.prototype.log =
|
|
36
|
+
Message.prototype.display = function(text, time, callback) {
|
|
37
|
+
var self = this;
|
|
41
38
|
|
|
42
39
|
if (typeof time === 'function') {
|
|
43
|
-
callback = time
|
|
44
|
-
time = null
|
|
40
|
+
callback = time;
|
|
41
|
+
time = null;
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
if (time == null)
|
|
48
|
-
time = 3
|
|
49
|
-
}
|
|
44
|
+
if (time == null) time = 3;
|
|
50
45
|
|
|
51
46
|
// Keep above:
|
|
52
47
|
// var parent = this.parent;
|
|
@@ -54,94 +49,77 @@ Message.prototype.log = Message.prototype.display = function (
|
|
|
54
49
|
// parent.append(this);
|
|
55
50
|
|
|
56
51
|
if (this.scrollable) {
|
|
57
|
-
this.screen.saveFocus()
|
|
58
|
-
this.focus()
|
|
59
|
-
this.scrollTo(0)
|
|
52
|
+
this.screen.saveFocus();
|
|
53
|
+
this.focus();
|
|
54
|
+
this.scrollTo(0);
|
|
60
55
|
}
|
|
61
56
|
|
|
62
|
-
this.show()
|
|
63
|
-
this.setContent(text)
|
|
64
|
-
this.screen.render()
|
|
57
|
+
this.show();
|
|
58
|
+
this.setContent(text);
|
|
59
|
+
this.screen.render();
|
|
65
60
|
|
|
66
61
|
if (time === Infinity || time === -1 || time === 0) {
|
|
67
|
-
|
|
68
|
-
if (end.done)
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
end.done = true
|
|
62
|
+
var end = function() {
|
|
63
|
+
if (end.done) return;
|
|
64
|
+
end.done = true;
|
|
72
65
|
if (self.scrollable) {
|
|
73
66
|
try {
|
|
74
|
-
self.screen.restoreFocus()
|
|
75
|
-
} catch (e) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
self.screen.render()
|
|
79
|
-
if (callback) {
|
|
80
|
-
callback()
|
|
67
|
+
self.screen.restoreFocus();
|
|
68
|
+
} catch (e) {
|
|
69
|
+
;
|
|
70
|
+
}
|
|
81
71
|
}
|
|
82
|
-
|
|
72
|
+
self.hide();
|
|
73
|
+
self.screen.render();
|
|
74
|
+
if (callback) callback();
|
|
75
|
+
};
|
|
83
76
|
|
|
84
|
-
setTimeout(function
|
|
77
|
+
setTimeout(function() {
|
|
85
78
|
self.onScreenEvent('keypress', function fn(ch, key) {
|
|
86
|
-
if (key.name === 'mouse')
|
|
87
|
-
return
|
|
88
|
-
}
|
|
79
|
+
if (key.name === 'mouse') return;
|
|
89
80
|
if (self.scrollable) {
|
|
90
|
-
if (
|
|
91
|
-
key.name === '
|
|
92
|
-
(self.options.vi && key.name === '
|
|
93
|
-
key.name === '
|
|
94
|
-
(self.options.vi && key.name === '
|
|
95
|
-
(self.options.vi && key.name === '
|
|
96
|
-
(self.options.vi && key.name === '
|
|
97
|
-
(self.options.vi && key.name === '
|
|
98
|
-
|
|
99
|
-
(self.options.vi && key.name === 'g' && !key.shift) ||
|
|
100
|
-
(self.options.vi && key.name === 'g' && key.shift)
|
|
101
|
-
) {
|
|
102
|
-
return
|
|
81
|
+
if ((key.name === 'up' || (self.options.vi && key.name === 'k'))
|
|
82
|
+
|| (key.name === 'down' || (self.options.vi && key.name === 'j'))
|
|
83
|
+
|| (self.options.vi && key.name === 'u' && key.ctrl)
|
|
84
|
+
|| (self.options.vi && key.name === 'd' && key.ctrl)
|
|
85
|
+
|| (self.options.vi && key.name === 'b' && key.ctrl)
|
|
86
|
+
|| (self.options.vi && key.name === 'f' && key.ctrl)
|
|
87
|
+
|| (self.options.vi && key.name === 'g' && !key.shift)
|
|
88
|
+
|| (self.options.vi && key.name === 'g' && key.shift)) {
|
|
89
|
+
return;
|
|
103
90
|
}
|
|
104
91
|
}
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
~self.options.ignoreKeys.indexOf(key.name)
|
|
108
|
-
) {
|
|
109
|
-
return
|
|
92
|
+
if (self.options.ignoreKeys && ~self.options.ignoreKeys.indexOf(key.name)) {
|
|
93
|
+
return;
|
|
110
94
|
}
|
|
111
|
-
self.removeScreenEvent('keypress', fn)
|
|
112
|
-
end()
|
|
113
|
-
})
|
|
95
|
+
self.removeScreenEvent('keypress', fn);
|
|
96
|
+
end();
|
|
97
|
+
});
|
|
114
98
|
// XXX May be affected by new element.options.mouse option.
|
|
115
|
-
if (!self.options.mouse)
|
|
116
|
-
return
|
|
117
|
-
}
|
|
99
|
+
if (!self.options.mouse) return;
|
|
118
100
|
self.onScreenEvent('mouse', function fn(data) {
|
|
119
|
-
if (data.action === 'mousemove')
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
})
|
|
125
|
-
}, 10)
|
|
101
|
+
if (data.action === 'mousemove') return;
|
|
102
|
+
self.removeScreenEvent('mouse', fn);
|
|
103
|
+
end();
|
|
104
|
+
});
|
|
105
|
+
}, 10);
|
|
126
106
|
|
|
127
|
-
return
|
|
107
|
+
return;
|
|
128
108
|
}
|
|
129
109
|
|
|
130
|
-
setTimeout(function
|
|
131
|
-
self.hide()
|
|
132
|
-
self.screen.render()
|
|
133
|
-
if (callback)
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}, time * 1000)
|
|
137
|
-
}
|
|
110
|
+
setTimeout(function() {
|
|
111
|
+
self.hide();
|
|
112
|
+
self.screen.render();
|
|
113
|
+
if (callback) callback();
|
|
114
|
+
}, time * 1000);
|
|
115
|
+
};
|
|
138
116
|
|
|
139
|
-
Message.prototype.error = function
|
|
140
|
-
return this.display('{red-fg}Error: ' + text + '{/red-fg}', time, callback)
|
|
141
|
-
}
|
|
117
|
+
Message.prototype.error = function(text, time, callback) {
|
|
118
|
+
return this.display('{red-fg}Error: ' + text + '{/red-fg}', time, callback);
|
|
119
|
+
};
|
|
142
120
|
|
|
143
121
|
/**
|
|
144
122
|
* Expose
|
|
145
123
|
*/
|
|
146
124
|
|
|
147
|
-
module.exports = Message
|
|
125
|
+
module.exports = Message;
|
|
@@ -10,306 +10,274 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var EventEmitter = require('../events').EventEmitter;
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Node
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
function Node(options) {
|
|
20
|
-
|
|
20
|
+
var self = this;
|
|
21
21
|
if (!(this instanceof Node)) {
|
|
22
|
-
return new Node(options)
|
|
22
|
+
return new Node(options);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
EventEmitter.call(this)
|
|
25
|
+
EventEmitter.call(this);
|
|
26
26
|
|
|
27
|
-
options = options || {}
|
|
28
|
-
this.options = options
|
|
27
|
+
options = options || {};
|
|
28
|
+
this.options = options;
|
|
29
29
|
|
|
30
|
-
this.screen = this.screen || options.screen
|
|
30
|
+
this.screen = this.screen || options.screen;
|
|
31
31
|
|
|
32
32
|
if (!this.screen) {
|
|
33
|
-
|
|
33
|
+
var Screen = require('./screen');
|
|
34
34
|
if (this.type === 'screen') {
|
|
35
|
-
this.screen = this
|
|
35
|
+
this.screen = this;
|
|
36
36
|
} else if (Screen.total === 1) {
|
|
37
|
-
this.screen = Screen.global
|
|
37
|
+
this.screen = Screen.global;
|
|
38
38
|
} else if (options.parent) {
|
|
39
|
-
this.screen = options.parent
|
|
39
|
+
this.screen = options.parent;
|
|
40
40
|
while (this.screen && this.screen.type !== 'screen') {
|
|
41
|
-
this.screen = this.screen.parent
|
|
41
|
+
this.screen = this.screen.parent;
|
|
42
42
|
}
|
|
43
43
|
} else if (Screen.total) {
|
|
44
44
|
// This _should_ work in most cases as long as the element is appended
|
|
45
45
|
// synchronously after the screen's creation. Throw error if not.
|
|
46
|
-
this.screen = Screen.instances[Screen.instances.length - 1]
|
|
47
|
-
process.nextTick(function
|
|
46
|
+
this.screen = Screen.instances[Screen.instances.length - 1];
|
|
47
|
+
process.nextTick(function() {
|
|
48
48
|
if (!self.parent) {
|
|
49
|
-
throw new Error(
|
|
50
|
-
'
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
" or `screen` option in the element's constructor" +
|
|
56
|
-
' if you are going to use multiple screens and' +
|
|
57
|
-
' append the element later.'
|
|
58
|
-
)
|
|
49
|
+
throw new Error('Element (' + self.type + ')'
|
|
50
|
+
+ ' was not appended synchronously after the'
|
|
51
|
+
+ ' screen\'s creation. Please set a `parent`'
|
|
52
|
+
+ ' or `screen` option in the element\'s constructor'
|
|
53
|
+
+ ' if you are going to use multiple screens and'
|
|
54
|
+
+ ' append the element later.');
|
|
59
55
|
}
|
|
60
|
-
})
|
|
56
|
+
});
|
|
61
57
|
} else {
|
|
62
|
-
throw new Error('No active screen.')
|
|
58
|
+
throw new Error('No active screen.');
|
|
63
59
|
}
|
|
64
60
|
}
|
|
65
61
|
|
|
66
|
-
this.parent = options.parent || null
|
|
67
|
-
this.children = []
|
|
68
|
-
this.$ = this._ = this.data = {}
|
|
69
|
-
this.uid = Node.uid
|
|
70
|
-
this.index = this.index != null ? this.index : -1
|
|
62
|
+
this.parent = options.parent || null;
|
|
63
|
+
this.children = [];
|
|
64
|
+
this.$ = this._ = this.data = {};
|
|
65
|
+
this.uid = Node.uid++;
|
|
66
|
+
this.index = this.index != null ? this.index : -1;
|
|
71
67
|
|
|
72
68
|
if (this.type !== 'screen') {
|
|
73
|
-
this.detached = true
|
|
69
|
+
this.detached = true;
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
if (this.parent) {
|
|
77
|
-
this.parent.append(this)
|
|
73
|
+
this.parent.append(this);
|
|
78
74
|
}
|
|
79
75
|
|
|
80
|
-
|
|
76
|
+
(options.children || []).forEach(this.append.bind(this));
|
|
81
77
|
}
|
|
82
78
|
|
|
83
|
-
Node.uid = 0
|
|
79
|
+
Node.uid = 0;
|
|
84
80
|
|
|
85
|
-
Object.setPrototypeOf(Node.prototype, EventEmitter.prototype)
|
|
81
|
+
Object.setPrototypeOf(Node.prototype, EventEmitter.prototype);
|
|
86
82
|
|
|
87
|
-
Node.prototype.type = 'node'
|
|
83
|
+
Node.prototype.type = 'node';
|
|
88
84
|
|
|
89
|
-
Node.prototype.insert = function
|
|
90
|
-
|
|
85
|
+
Node.prototype.insert = function(element, i) {
|
|
86
|
+
var self = this;
|
|
91
87
|
|
|
92
88
|
if (element.screen && element.screen !== this.screen) {
|
|
93
|
-
throw new Error(
|
|
89
|
+
throw new Error('Cannot switch a node\'s screen.');
|
|
94
90
|
}
|
|
95
91
|
|
|
96
|
-
element.detach()
|
|
97
|
-
element.parent = this
|
|
98
|
-
element.screen = this.screen
|
|
92
|
+
element.detach();
|
|
93
|
+
element.parent = this;
|
|
94
|
+
element.screen = this.screen;
|
|
99
95
|
|
|
100
96
|
if (i === 0) {
|
|
101
|
-
this.children.unshift(element)
|
|
97
|
+
this.children.unshift(element);
|
|
102
98
|
} else if (i === this.children.length) {
|
|
103
|
-
this.children.push(element)
|
|
99
|
+
this.children.push(element);
|
|
104
100
|
} else {
|
|
105
|
-
this.children.splice(i, 0, element)
|
|
101
|
+
this.children.splice(i, 0, element);
|
|
106
102
|
}
|
|
107
103
|
|
|
108
|
-
element.emit('reparent', this)
|
|
109
|
-
this.emit('adopt', element)
|
|
104
|
+
element.emit('reparent', this);
|
|
105
|
+
this.emit('adopt', element);
|
|
110
106
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
el.detached = self.detached
|
|
114
|
-
if (n)
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
el.children.forEach(emit)
|
|
118
|
-
})(element)
|
|
107
|
+
(function emit(el) {
|
|
108
|
+
var n = el.detached !== self.detached;
|
|
109
|
+
el.detached = self.detached;
|
|
110
|
+
if (n) el.emit('attach');
|
|
111
|
+
el.children.forEach(emit);
|
|
112
|
+
})(element);
|
|
119
113
|
|
|
120
114
|
if (!this.screen.focused) {
|
|
121
|
-
this.screen.focused = element
|
|
115
|
+
this.screen.focused = element;
|
|
122
116
|
}
|
|
123
|
-
}
|
|
117
|
+
};
|
|
124
118
|
|
|
125
|
-
Node.prototype.prepend = function
|
|
126
|
-
this.insert(element, 0)
|
|
127
|
-
}
|
|
119
|
+
Node.prototype.prepend = function(element) {
|
|
120
|
+
this.insert(element, 0);
|
|
121
|
+
};
|
|
128
122
|
|
|
129
|
-
Node.prototype.append = function
|
|
130
|
-
this.insert(element, this.children.length)
|
|
131
|
-
}
|
|
123
|
+
Node.prototype.append = function(element) {
|
|
124
|
+
this.insert(element, this.children.length);
|
|
125
|
+
};
|
|
132
126
|
|
|
133
|
-
Node.prototype.insertBefore = function
|
|
134
|
-
|
|
135
|
-
if (~i)
|
|
136
|
-
|
|
137
|
-
}
|
|
138
|
-
}
|
|
127
|
+
Node.prototype.insertBefore = function(element, other) {
|
|
128
|
+
var i = this.children.indexOf(other);
|
|
129
|
+
if (~i) this.insert(element, i);
|
|
130
|
+
};
|
|
139
131
|
|
|
140
|
-
Node.prototype.insertAfter = function
|
|
141
|
-
|
|
142
|
-
if (~i)
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
}
|
|
132
|
+
Node.prototype.insertAfter = function(element, other) {
|
|
133
|
+
var i = this.children.indexOf(other);
|
|
134
|
+
if (~i) this.insert(element, i + 1);
|
|
135
|
+
};
|
|
146
136
|
|
|
147
|
-
Node.prototype.remove = function
|
|
148
|
-
if (element.parent !== this)
|
|
149
|
-
return
|
|
150
|
-
}
|
|
137
|
+
Node.prototype.remove = function(element) {
|
|
138
|
+
if (element.parent !== this) return;
|
|
151
139
|
|
|
152
|
-
|
|
153
|
-
if (!~i)
|
|
154
|
-
return
|
|
155
|
-
}
|
|
140
|
+
var i = this.children.indexOf(element);
|
|
141
|
+
if (!~i) return;
|
|
156
142
|
|
|
157
|
-
element.clearPos()
|
|
143
|
+
element.clearPos();
|
|
158
144
|
|
|
159
|
-
element.parent = null
|
|
145
|
+
element.parent = null;
|
|
160
146
|
|
|
161
|
-
this.children.splice(i, 1)
|
|
147
|
+
this.children.splice(i, 1);
|
|
162
148
|
|
|
163
|
-
i = this.screen.clickable.indexOf(element)
|
|
164
|
-
if (~i)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
i = this.screen.keyable.indexOf(element)
|
|
168
|
-
if (~i) {
|
|
169
|
-
this.screen.keyable.splice(i, 1)
|
|
170
|
-
}
|
|
149
|
+
i = this.screen.clickable.indexOf(element);
|
|
150
|
+
if (~i) this.screen.clickable.splice(i, 1);
|
|
151
|
+
i = this.screen.keyable.indexOf(element);
|
|
152
|
+
if (~i) this.screen.keyable.splice(i, 1);
|
|
171
153
|
|
|
172
|
-
element.emit('reparent', null)
|
|
173
|
-
this.emit('remove', element)
|
|
154
|
+
element.emit('reparent', null);
|
|
155
|
+
this.emit('remove', element);
|
|
174
156
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
el.detached = true
|
|
178
|
-
if (n)
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
el.children.forEach(emit)
|
|
182
|
-
})(element)
|
|
157
|
+
(function emit(el) {
|
|
158
|
+
var n = el.detached !== true;
|
|
159
|
+
el.detached = true;
|
|
160
|
+
if (n) el.emit('detach');
|
|
161
|
+
el.children.forEach(emit);
|
|
162
|
+
})(element);
|
|
183
163
|
|
|
184
164
|
if (this.screen.focused === element) {
|
|
185
|
-
this.screen.rewindFocus()
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
Node.prototype.detach = function () {
|
|
190
|
-
if (this.parent) {
|
|
191
|
-
this.parent.remove(this)
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
Node.prototype.free = function () {
|
|
196
|
-
return
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
Node.prototype.destroy = function () {
|
|
200
|
-
this.detach()
|
|
201
|
-
this.forDescendants(function (el) {
|
|
202
|
-
el.free()
|
|
203
|
-
el.destroyed = true
|
|
204
|
-
el.emit('destroy')
|
|
205
|
-
}, this)
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
Node.prototype.forDescendants = function (iter, s) {
|
|
209
|
-
if (s) {
|
|
210
|
-
iter(this)
|
|
165
|
+
this.screen.rewindFocus();
|
|
211
166
|
}
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
Node.prototype.detach = function() {
|
|
170
|
+
if (this.parent) this.parent.remove(this);
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
Node.prototype.free = function() {
|
|
174
|
+
return;
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
Node.prototype.destroy = function() {
|
|
178
|
+
this.detach();
|
|
179
|
+
this.forDescendants(function(el) {
|
|
180
|
+
el.free();
|
|
181
|
+
el.destroyed = true;
|
|
182
|
+
el.emit('destroy');
|
|
183
|
+
}, this);
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
Node.prototype.forDescendants = function(iter, s) {
|
|
187
|
+
if (s) iter(this);
|
|
212
188
|
this.children.forEach(function emit(el) {
|
|
213
|
-
iter(el)
|
|
214
|
-
el.children.forEach(emit)
|
|
215
|
-
})
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
Node.prototype.forAncestors = function
|
|
219
|
-
|
|
220
|
-
if (s)
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
while ((el = el.parent)) {
|
|
224
|
-
iter(el)
|
|
189
|
+
iter(el);
|
|
190
|
+
el.children.forEach(emit);
|
|
191
|
+
});
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
Node.prototype.forAncestors = function(iter, s) {
|
|
195
|
+
var el = this;
|
|
196
|
+
if (s) iter(this);
|
|
197
|
+
while (el = el.parent) {
|
|
198
|
+
iter(el);
|
|
225
199
|
}
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
Node.prototype.collectDescendants = function
|
|
229
|
-
|
|
230
|
-
this.forDescendants(function
|
|
231
|
-
out.push(el)
|
|
232
|
-
}, s)
|
|
233
|
-
return out
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
Node.prototype.collectAncestors = function
|
|
237
|
-
|
|
238
|
-
this.forAncestors(function
|
|
239
|
-
out.push(el)
|
|
240
|
-
}, s)
|
|
241
|
-
return out
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
Node.prototype.emitDescendants = function
|
|
245
|
-
|
|
246
|
-
iter
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
Node.prototype.collectDescendants = function(s) {
|
|
203
|
+
var out = [];
|
|
204
|
+
this.forDescendants(function(el) {
|
|
205
|
+
out.push(el);
|
|
206
|
+
}, s);
|
|
207
|
+
return out;
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
Node.prototype.collectAncestors = function(s) {
|
|
211
|
+
var out = [];
|
|
212
|
+
this.forAncestors(function(el) {
|
|
213
|
+
out.push(el);
|
|
214
|
+
}, s);
|
|
215
|
+
return out;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
Node.prototype.emitDescendants = function() {
|
|
219
|
+
var args = Array.prototype.slice(arguments)
|
|
220
|
+
, iter;
|
|
247
221
|
|
|
248
222
|
if (typeof args[args.length - 1] === 'function') {
|
|
249
|
-
iter = args.pop()
|
|
223
|
+
iter = args.pop();
|
|
250
224
|
}
|
|
251
225
|
|
|
252
|
-
return this.forDescendants(function
|
|
253
|
-
if (iter)
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
}, true)
|
|
258
|
-
}
|
|
226
|
+
return this.forDescendants(function(el) {
|
|
227
|
+
if (iter) iter(el);
|
|
228
|
+
el.emit.apply(el, args);
|
|
229
|
+
}, true);
|
|
230
|
+
};
|
|
259
231
|
|
|
260
|
-
Node.prototype.emitAncestors = function
|
|
261
|
-
|
|
262
|
-
iter
|
|
232
|
+
Node.prototype.emitAncestors = function() {
|
|
233
|
+
var args = Array.prototype.slice(arguments)
|
|
234
|
+
, iter;
|
|
263
235
|
|
|
264
236
|
if (typeof args[args.length - 1] === 'function') {
|
|
265
|
-
iter = args.pop()
|
|
237
|
+
iter = args.pop();
|
|
266
238
|
}
|
|
267
239
|
|
|
268
|
-
return this.forAncestors(function
|
|
269
|
-
if (iter)
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
}, true)
|
|
274
|
-
}
|
|
240
|
+
return this.forAncestors(function(el) {
|
|
241
|
+
if (iter) iter(el);
|
|
242
|
+
el.emit.apply(el, args);
|
|
243
|
+
}, true);
|
|
244
|
+
};
|
|
275
245
|
|
|
276
|
-
Node.prototype.hasDescendant = function
|
|
246
|
+
Node.prototype.hasDescendant = function(target) {
|
|
277
247
|
return (function find(el) {
|
|
278
|
-
for (
|
|
248
|
+
for (var i = 0; i < el.children.length; i++) {
|
|
279
249
|
if (el.children[i] === target) {
|
|
280
|
-
return true
|
|
250
|
+
return true;
|
|
281
251
|
}
|
|
282
252
|
if (find(el.children[i]) === true) {
|
|
283
|
-
return true
|
|
253
|
+
return true;
|
|
284
254
|
}
|
|
285
255
|
}
|
|
286
|
-
return false
|
|
287
|
-
})(this)
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
Node.prototype.hasAncestor = function
|
|
291
|
-
|
|
292
|
-
while (
|
|
293
|
-
if (el === target)
|
|
294
|
-
return true
|
|
295
|
-
}
|
|
256
|
+
return false;
|
|
257
|
+
})(this);
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
Node.prototype.hasAncestor = function(target) {
|
|
261
|
+
var el = this;
|
|
262
|
+
while (el = el.parent) {
|
|
263
|
+
if (el === target) return true;
|
|
296
264
|
}
|
|
297
|
-
return false
|
|
298
|
-
}
|
|
265
|
+
return false;
|
|
266
|
+
};
|
|
299
267
|
|
|
300
|
-
Node.prototype.get = function
|
|
268
|
+
Node.prototype.get = function(name, value) {
|
|
301
269
|
if (this.data.hasOwnProperty(name)) {
|
|
302
|
-
return this.data[name]
|
|
270
|
+
return this.data[name];
|
|
303
271
|
}
|
|
304
|
-
return value
|
|
305
|
-
}
|
|
272
|
+
return value;
|
|
273
|
+
};
|
|
306
274
|
|
|
307
|
-
Node.prototype.set = function
|
|
308
|
-
return
|
|
309
|
-
}
|
|
275
|
+
Node.prototype.set = function(name, value) {
|
|
276
|
+
return this.data[name] = value;
|
|
277
|
+
};
|
|
310
278
|
|
|
311
279
|
/**
|
|
312
280
|
* Expose
|
|
313
281
|
*/
|
|
314
282
|
|
|
315
|
-
module.exports = Node
|
|
283
|
+
module.exports = Node;
|