@fbincon/claude-code-statusline 0.0.0-stage → 3.0.0-beta.1
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/LICENSE +21 -0
- package/LICENSE-Unicode.txt +39 -0
- package/LICENSE-Wcwidth.txt +27 -0
- package/README.md +90 -2
- package/bin/claude-statusline.js +2 -0
- package/candidate.json +1238 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.d.ts +35 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js +228 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +140 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js +101 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/host.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js +96 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/operations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.d.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js +99 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.d.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/storage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js +89 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/entry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js +67 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/help.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/arguments.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js +63 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/configure.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js +153 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/doctor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.d.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/editor.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js +142 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/install.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/launcher.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js +109 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mod-ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.d.ts +60 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js +12 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.d.ts +10 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js +234 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/mods.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js +41 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.d.ts +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/paths.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js +92 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/plan.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js +91 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/resources.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js +94 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/slash-hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.d.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/integration/transaction.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.d.ts +22 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js +197 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.d.ts +7 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js +134 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.d.ts +58 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/journal.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js +125 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/official.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js +55 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/recovery/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +95 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.d.ts +6 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js +48 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/main.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.d.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js +11 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.d.ts +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js +162 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.d.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js +19 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/hook.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.d.ts +37 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/io.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.d.ts +9 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js +241 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/json-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.d.ts +2 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js +14 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.d.ts +15 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/durations.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.d.ts +16 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +90 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.d.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js +80 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.d.ts +4 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js +40 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.d.ts +5 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js +59 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/collect.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js +69 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/service.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.d.ts +17 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js +70 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/store.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.d.ts +13 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js +75 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/tasks/submissions.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.d.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js +227 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +144 -0
- package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -0
- package/node_modules/@fbincon/statusline-cli/package.json +17 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-config/SKILL.md +80 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-configure/SKILL.md +19 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +37 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/hooks.json +6 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +820 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +503 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/forms.ts +3 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +198 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/messages.ts +101 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +218 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/appearance.ts +29 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +254 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/forms.ts +167 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/guidance.ts +20 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/import-review.ts +55 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/instances.ts +30 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/navigation.ts +98 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/numeric.ts +42 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/search.ts +114 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +276 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-unicode.ts +92 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +6842 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/index.ts +40 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/messages.ts +33 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/presentation.ts +62 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preferences.ts +61 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/preview-preferences.ts +8 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +124 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/unicode.ts +121 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +47 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +159 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +84 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/surface.ts +89 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/catalog.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/preview.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/section.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/components/shortcuts.ts +83 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/layout.ts +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/styled-text.ts +56 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/text.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/theme.ts +27 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +49 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/hooks.json +1 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/hooks/observe.ts +279 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/checklists.ts +45 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/costs.ts +23 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/generated-contracts.ts +18 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/identity.ts +14 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/launch.ts +25 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/queue.ts +68 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/streams.ts +28 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/lib/timing.ts +11 -0
- package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js +72 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.d.ts +86 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js +3462 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog-data.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/defaults.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +232 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js +48 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/editor-fields.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js +99 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/formatting.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/generated-constants.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js +80 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.d.ts +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js +159 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/transfer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.d.ts +15 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js +55 -0
- package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/runtime.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +663 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +401 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +251 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js +146 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/forms.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js +17 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/guidance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js +53 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/import-review.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/instances.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.d.ts +37 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/navigation.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.d.ts +11 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/numeric.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js +122 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/search.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js +30 -0
- package/node_modules/@fbincon/statusline-core/dist/src/editor/text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +6841 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js +38 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/messages.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/registry.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/en.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ja.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/ko.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-CN.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.d.ts +222 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js +224 -0
- package/node_modules/@fbincon/statusline-core/dist/src/i18n/statusline/zh-Hant.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/integration/binding.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js +31 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-equality.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js +137 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-read.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js +56 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json-text.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js +165 -0
- package/node_modules/@fbincon/statusline-core/dist/src/json.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js +47 -0
- package/node_modules/@fbincon/statusline-core/dist/src/numbers.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.d.ts +21 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js +105 -0
- package/node_modules/@fbincon/statusline-core/dist/src/ordered-record.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/release.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js +73 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/appearance.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.d.ts +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/coercion.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/colors.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js +58 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/formatters.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js +34 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.d.ts +49 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +399 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/language.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.d.ts +19 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js +176 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js +29 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/live.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/metrics.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.d.ts +3 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js +46 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/numeric-format.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.d.ts +23 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/palette.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +76 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.d.ts +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js +98 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preferences.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.d.ts +67 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js +14 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js +116 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/styles.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.d.ts +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +305 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js +33 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js +52 -0
- package/node_modules/@fbincon/statusline-core/dist/src/rendering/visibility.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.d.ts +9 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js +115 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/git.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js +104 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/bindings.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.d.ts +27 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js +196 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js +45 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/ownership.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js +228 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/reducer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.d.ts +24 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js +145 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/requests.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js +70 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/snapshot.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.d.ts +36 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js +110 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/live/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/agents.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.d.ts +10 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js +121 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/hooks.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.d.ts +43 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js +198 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/model.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js +192 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.d.ts +16 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js +245 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/transitions.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.d.ts +4 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js +28 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/tasks/view.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.d.ts +26 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js +183 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/transcript.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.d.ts +64 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js +263 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/usage.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.d.ts +18 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js +103 -0
- package/node_modules/@fbincon/statusline-core/dist/src/runtime/values.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.d.ts +7 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js +2 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.d.ts +6 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js +50 -0
- package/node_modules/@fbincon/statusline-core/dist/src/terminal/spans.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.d.ts +8 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js +13 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/sample.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.d.ts +22 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js +75 -0
- package/node_modules/@fbincon/statusline-core/dist/src/timing/timer.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.d.ts +12 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js +93 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/generated-unicode.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.d.ts +5 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js +178 -0
- package/node_modules/@fbincon/statusline-core/dist/src/unicode/index.js.map +1 -0
- package/node_modules/@fbincon/statusline-core/package.json +8 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/languages.json +7 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +1367 -0
- package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-Hant.json +1367 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js +22 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/architecture.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js +102 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/clocks.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.d.ts +16 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/command.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js +160 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/commands.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.d.ts +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js +19 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/errors.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.d.ts +8 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js +164 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/files.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/hash.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js +14 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.d.ts +12 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js +21 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/launch.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js +31 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/line-cursor.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.d.ts +15 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js +36 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/native.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.d.ts +17 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js +44 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/plugin-host.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.d.ts +4 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js +48 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/presentation.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.d.ts +2 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js +67 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/processes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.d.ts +42 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js +180 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/bridge.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.d.ts +11 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js +81 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.d.ts +32 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js +157 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/launchers.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.d.ts +18 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js +150 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.d.ts +6 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js +39 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/terminal/windows-modes.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.d.ts +5 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js +82 -0
- package/node_modules/@fbincon/statusline-platform/dist/src/utf8.js.map +1 -0
- package/node_modules/@fbincon/statusline-platform/package.json +8 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.d.ts +16 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +213 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.d.ts +30 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js +34 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/layout.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.d.ts +28 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js +126 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +52 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js +352 -0
- package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -0
- package/node_modules/@fbincon/statusline-tui/package.json +16 -0
- package/node_modules/@koromix/koffi-darwin-arm64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-arm64/darwin_arm64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-arm64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-arm64/package.json +24 -0
- package/node_modules/@koromix/koffi-darwin-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-darwin-x64/darwin_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-darwin-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-darwin-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-linux-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-linux-x64/index.js +198 -0
- package/node_modules/@koromix/koffi-linux-x64/linux_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/musl_x64/koffi.node +0 -0
- package/node_modules/@koromix/koffi-linux-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/README.md +6 -0
- package/node_modules/@koromix/koffi-win32-x64/index.js +1 -0
- package/node_modules/@koromix/koffi-win32-x64/package.json +24 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.lib +0 -0
- package/node_modules/@koromix/koffi-win32-x64/win32_x64/koffi.node +0 -0
- package/node_modules/koffi/LICENSE.txt +22 -0
- package/node_modules/koffi/README.md +46 -0
- package/node_modules/koffi/index.cjs +1 -0
- package/node_modules/koffi/index.d.ts +390 -0
- package/node_modules/koffi/index.js +2 -0
- package/node_modules/koffi/indirect.cjs +1 -0
- package/node_modules/koffi/indirect.js +2 -0
- package/node_modules/koffi/package.json +73 -0
- package/node_modules/koffi/src/koffi/index.cjs +327 -0
- package/node_modules/koffi/src/koffi/index.js +312 -0
- package/node_modules/koffi/src/koffi/indirect.cjs +326 -0
- package/node_modules/koffi/src/koffi/indirect.js +311 -0
- package/node_modules/koffi/src/koffi/src/static.cjs +170 -0
- package/node_modules/koffi/src/koffi/src/static.js +173 -0
- package/node_modules/lossless-json/LICENSE.md +9 -0
- package/node_modules/lossless-json/README.md +549 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js +92 -0
- package/node_modules/lossless-json/lib/esm/LosslessNumber.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/config.js +9 -0
- package/node_modules/lossless-json/lib/esm/config.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/index.js +9 -0
- package/node_modules/lossless-json/lib/esm/index.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js +9 -0
- package/node_modules/lossless-json/lib/esm/numberParsers.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/package.json +3 -0
- package/node_modules/lossless-json/lib/esm/parse.js +346 -0
- package/node_modules/lossless-json/lib/esm/parse.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/revive.js +57 -0
- package/node_modules/lossless-json/lib/esm/revive.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js +10 -0
- package/node_modules/lossless-json/lib/esm/reviveDate.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/stringify.js +166 -0
- package/node_modules/lossless-json/lib/esm/stringify.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/types.js +2 -0
- package/node_modules/lossless-json/lib/esm/types.js.map +1 -0
- package/node_modules/lossless-json/lib/esm/utils.js +236 -0
- package/node_modules/lossless-json/lib/esm/utils.js.map +1 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts +40 -0
- package/node_modules/lossless-json/lib/types/LosslessNumber.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/config.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/config.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/index.d.ts +9 -0
- package/node_modules/lossless-json/lib/types/index.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts +4 -0
- package/node_modules/lossless-json/lib/types/numberParsers.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts +33 -0
- package/node_modules/lossless-json/lib/types/parse.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts +13 -0
- package/node_modules/lossless-json/lib/types/revive.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts +5 -0
- package/node_modules/lossless-json/lib/types/reviveDate.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts +37 -0
- package/node_modules/lossless-json/lib/types/stringify.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/types.d.ts +61 -0
- package/node_modules/lossless-json/lib/types/types.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts +79 -0
- package/node_modules/lossless-json/lib/types/utils.d.ts.map +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js +1 -0
- package/node_modules/lossless-json/lib/umd/lossless-json.js.map +1 -0
- package/node_modules/lossless-json/lib/umd/package.json +3 -0
- package/node_modules/lossless-json/package.json +89 -0
- package/package.json +57 -4
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type Language } from '../i18n/messages.js';
|
|
2
|
+
import type { CatalogItem, DescribeResult, Draft, ReadResult, Scope } from '../contracts/ui.js';
|
|
3
|
+
import type { Match } from './search.js';
|
|
4
|
+
import type { ReviewState } from './import-review.js';
|
|
5
|
+
import type { LocalizedText } from '../i18n/messages.js';
|
|
6
|
+
import type { NumericField } from './numeric.js';
|
|
7
|
+
export type { NumericField } from './numeric.js';
|
|
8
|
+
export type Page = 'main' | 'subagents' | 'settings' | 'layout';
|
|
9
|
+
/** Copy wire data without sharing editable arrays with the opening snapshot. */
|
|
10
|
+
export declare function copyDraft(draft: Draft): Draft;
|
|
11
|
+
export declare function sameDraft(left: Draft, right: Draft): boolean;
|
|
12
|
+
/** Pure tool draft. Persistence and host configuration calls live in the hook. */
|
|
13
|
+
export declare class Editor {
|
|
14
|
+
readonly description: DescribeResult;
|
|
15
|
+
draft: Draft;
|
|
16
|
+
baseline: ReadResult;
|
|
17
|
+
page: Page;
|
|
18
|
+
advanced: boolean;
|
|
19
|
+
adding: boolean;
|
|
20
|
+
pickerSaved: {
|
|
21
|
+
search: string;
|
|
22
|
+
category: string;
|
|
23
|
+
selected: string;
|
|
24
|
+
} | null;
|
|
25
|
+
detail: {
|
|
26
|
+
scope: Scope;
|
|
27
|
+
id: string;
|
|
28
|
+
} | null;
|
|
29
|
+
guidanceScroll: number | null;
|
|
30
|
+
review: ReviewState | null;
|
|
31
|
+
preset: string;
|
|
32
|
+
path: string;
|
|
33
|
+
pendingTransfer: 'import' | 'export' | 'preset' | null;
|
|
34
|
+
setting: string;
|
|
35
|
+
activeNumeric: NumericField | null;
|
|
36
|
+
selected: Record<Scope, string>;
|
|
37
|
+
order: Record<Scope, string[]>;
|
|
38
|
+
search: Record<Scope, string>;
|
|
39
|
+
category: Record<Scope, string>;
|
|
40
|
+
buffers: Record<NumericField, string>;
|
|
41
|
+
fieldErrors: Partial<Record<NumericField, string>>;
|
|
42
|
+
fieldErrorMessages: Partial<Record<NumericField, LocalizedText>>;
|
|
43
|
+
constructor(description: DescribeResult, current: ReadResult);
|
|
44
|
+
replaceDraft(draft: Draft): void;
|
|
45
|
+
get modified(): boolean;
|
|
46
|
+
catalog(scope: Scope): CatalogItem[];
|
|
47
|
+
items(scope: Scope): string[];
|
|
48
|
+
instance(scope: Scope, id: string): import("../contracts/ui.js").InstanceDraft | undefined;
|
|
49
|
+
definition(scope: Scope, id: string): CatalogItem | undefined;
|
|
50
|
+
instanceLabel(scope: Scope, id: string, language?: Language): string;
|
|
51
|
+
visible(scope: Scope): CatalogItem[];
|
|
52
|
+
matches(scope: Scope): {
|
|
53
|
+
item: CatalogItem & {
|
|
54
|
+
type_id?: string;
|
|
55
|
+
custom_label?: string | null;
|
|
56
|
+
ordinal?: number;
|
|
57
|
+
};
|
|
58
|
+
match: Match;
|
|
59
|
+
}[];
|
|
60
|
+
openPicker(scope: Scope): void;
|
|
61
|
+
closePicker(scope: Scope): void;
|
|
62
|
+
instanceAction(scope: Scope, action: 'add' | 'copy' | 'remove', typeId?: string): boolean;
|
|
63
|
+
categories(scope: Scope): string[];
|
|
64
|
+
filtered(scope: Scope): boolean;
|
|
65
|
+
chooseCategory(scope: Scope, category: string): void;
|
|
66
|
+
filter(scope: Scope, value: string): void;
|
|
67
|
+
toggle(scope: Scope, id: string): boolean;
|
|
68
|
+
move(scope: Scope, delta: -1 | 1): boolean;
|
|
69
|
+
setBuffer(field: NumericField, value: string): void;
|
|
70
|
+
cancelNumeric(field?: NumericField): void;
|
|
71
|
+
acceptNumeric(field?: NumericField): boolean;
|
|
72
|
+
committed(current: ReadResult): void;
|
|
73
|
+
}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import { t } from '../i18n/messages.js';
|
|
2
|
+
import { nodes, newInstance, reconcileRows } from './instances.js';
|
|
3
|
+
import { isDraft } from './backend.js';
|
|
4
|
+
import { NUMERIC_FIELDS, numericValue, numericDiagnostic } from './numeric.js';
|
|
5
|
+
import { bestMatch, fields, normalize } from './search.js';
|
|
6
|
+
/** Copy wire data without sharing editable arrays with the opening snapshot. */
|
|
7
|
+
export function copyDraft(draft) {
|
|
8
|
+
return JSON.parse(JSON.stringify(draft));
|
|
9
|
+
}
|
|
10
|
+
export function sameDraft(left, right) {
|
|
11
|
+
return JSON.stringify(left) === JSON.stringify(right);
|
|
12
|
+
}
|
|
13
|
+
/** Pure tool draft. Persistence and host configuration calls live in the hook. */
|
|
14
|
+
export class Editor {
|
|
15
|
+
description;
|
|
16
|
+
draft;
|
|
17
|
+
baseline;
|
|
18
|
+
page = 'main';
|
|
19
|
+
advanced = false;
|
|
20
|
+
adding = false;
|
|
21
|
+
pickerSaved = null;
|
|
22
|
+
detail = null;
|
|
23
|
+
guidanceScroll = null;
|
|
24
|
+
review = null;
|
|
25
|
+
preset = 'minimal';
|
|
26
|
+
path = 'statusline.json';
|
|
27
|
+
pendingTransfer = null;
|
|
28
|
+
setting = 'colors';
|
|
29
|
+
activeNumeric = null;
|
|
30
|
+
selected;
|
|
31
|
+
order;
|
|
32
|
+
search = { main: '', subagent: '' };
|
|
33
|
+
category = { main: 'all', subagent: 'all' };
|
|
34
|
+
buffers;
|
|
35
|
+
fieldErrors = {};
|
|
36
|
+
fieldErrorMessages = {};
|
|
37
|
+
constructor(description, current) {
|
|
38
|
+
this.description = description;
|
|
39
|
+
description.catalog.forEach(item => fields(item));
|
|
40
|
+
this.baseline = { ...current, draft: copyDraft(current.draft) };
|
|
41
|
+
this.draft = copyDraft(current.draft);
|
|
42
|
+
this.order = { main: [], subagent: [] };
|
|
43
|
+
this.selected = { main: '', subagent: '' };
|
|
44
|
+
for (const scope of ['main', 'subagent']) {
|
|
45
|
+
this.order[scope] = nodes(this.draft, scope).map(i => i.id);
|
|
46
|
+
this.selected[scope] = this.order[scope][0] || '';
|
|
47
|
+
}
|
|
48
|
+
this.buffers = {
|
|
49
|
+
padding: String(this.draft.host.padding),
|
|
50
|
+
refresh_interval: String(this.draft.host.refresh_interval),
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
replaceDraft(draft) {
|
|
54
|
+
this.draft = copyDraft(draft);
|
|
55
|
+
for (const scope of ['main', 'subagent']) {
|
|
56
|
+
this.order[scope] = nodes(this.draft, scope).map(i => i.id);
|
|
57
|
+
if (!this.order[scope].includes(this.selected[scope]))
|
|
58
|
+
this.selected[scope] = this.order[scope][0] || '';
|
|
59
|
+
}
|
|
60
|
+
this.buffers = { padding: String(draft.host.padding), refresh_interval: String(draft.host.refresh_interval) };
|
|
61
|
+
this.fieldErrors = {};
|
|
62
|
+
this.fieldErrorMessages = {};
|
|
63
|
+
this.activeNumeric = null;
|
|
64
|
+
this.detail = null;
|
|
65
|
+
this.guidanceScroll = null;
|
|
66
|
+
this.review = null;
|
|
67
|
+
}
|
|
68
|
+
get modified() {
|
|
69
|
+
return (!sameDraft(this.draft, this.baseline.draft) ||
|
|
70
|
+
this.buffers.padding !== String(this.draft.host.padding) ||
|
|
71
|
+
this.buffers.refresh_interval !== String(this.draft.host.refresh_interval));
|
|
72
|
+
}
|
|
73
|
+
catalog(scope) {
|
|
74
|
+
return this.description.catalog.filter((item) => item.scope === scope);
|
|
75
|
+
}
|
|
76
|
+
items(scope) {
|
|
77
|
+
return nodes(this.draft, scope).filter(i => i.enabled).map(i => i.id);
|
|
78
|
+
}
|
|
79
|
+
instance(scope, id) { return nodes(this.draft, scope).find(i => i.id === id); }
|
|
80
|
+
definition(scope, id) {
|
|
81
|
+
return this.catalog(scope).find(i => i.id === (this.instance(scope, id)?.type_id ?? id));
|
|
82
|
+
}
|
|
83
|
+
instanceLabel(scope, id, language = 'en') {
|
|
84
|
+
const node = this.instance(scope, id), type = node?.type_id ?? id;
|
|
85
|
+
const peers = nodes(this.draft, scope).filter(i => i.type_id === type);
|
|
86
|
+
return (node?.options.label || (type === 'text' ? node?.text : null) || t(`items.${scope}.${type}.label`, language)) +
|
|
87
|
+
(node && peers.length > 1 ? ` (${peers.indexOf(node) + 1})` : '');
|
|
88
|
+
}
|
|
89
|
+
visible(scope) { return this.matches(scope).map(result => result.item); }
|
|
90
|
+
matches(scope) {
|
|
91
|
+
const catalog = new Map(this.catalog(scope).map(item => [item.id, item]));
|
|
92
|
+
const order = this.adding ? [...catalog.keys()] : this.order[scope];
|
|
93
|
+
return order.flatMap(id => {
|
|
94
|
+
const node = this.adding ? undefined : this.instance(scope, id);
|
|
95
|
+
const definition = catalog.get(node?.type_id ?? id);
|
|
96
|
+
if (!definition || (this.category[scope] !== 'all' && definition.group !== this.category[scope]))
|
|
97
|
+
return [];
|
|
98
|
+
const peers = node ? nodes(this.draft, scope).filter(i => i.type_id === node.type_id) : [];
|
|
99
|
+
const item = { ...definition, id, type_id: definition.id, custom_label: node?.options.label || (node?.type_id === 'text' ? node.text : null), ordinal: peers.length > 1 ? peers.indexOf(node) + 1 : undefined };
|
|
100
|
+
const match = normalize(this.search[scope]).characters.length
|
|
101
|
+
? bestMatch(fields(definition, item.custom_label), this.search[scope])
|
|
102
|
+
: { rank: 5, positions: [], text: id, field: 'id' };
|
|
103
|
+
return match ? [{ item, match }] : [];
|
|
104
|
+
}).sort((a, b) => a.match.rank - b.match.rank);
|
|
105
|
+
}
|
|
106
|
+
openPicker(scope) {
|
|
107
|
+
this.pickerSaved = { search: this.search[scope], category: this.category[scope], selected: this.selected[scope] };
|
|
108
|
+
this.adding = true;
|
|
109
|
+
this.search[scope] = '';
|
|
110
|
+
this.category[scope] = 'all';
|
|
111
|
+
this.selected[scope] = this.catalog(scope)[0]?.id ?? '';
|
|
112
|
+
}
|
|
113
|
+
closePicker(scope) {
|
|
114
|
+
if (this.pickerSaved) {
|
|
115
|
+
this.search[scope] = this.pickerSaved.search;
|
|
116
|
+
this.category[scope] = this.pickerSaved.category;
|
|
117
|
+
this.selected[scope] = this.pickerSaved.selected;
|
|
118
|
+
}
|
|
119
|
+
this.adding = false;
|
|
120
|
+
this.pickerSaved = null;
|
|
121
|
+
}
|
|
122
|
+
instanceAction(scope, action, typeId) {
|
|
123
|
+
const draft = copyDraft(this.draft), list = nodes(draft, scope);
|
|
124
|
+
const selected = this.adding ? this.pickerSaved?.selected : this.selected[scope];
|
|
125
|
+
const index = list.findIndex(i => i.id === selected);
|
|
126
|
+
let next = selected ?? '';
|
|
127
|
+
if (action === 'remove') {
|
|
128
|
+
if (index < 0)
|
|
129
|
+
return false;
|
|
130
|
+
list.splice(index, 1);
|
|
131
|
+
next = list[Math.min(index, list.length - 1)]?.id ?? '';
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
if (action === 'copy' && index < 0)
|
|
135
|
+
return false;
|
|
136
|
+
const node = newInstance(typeId ?? list[index].type_id, list, action === 'copy' ? list[index] : undefined);
|
|
137
|
+
list.splice(index < 0 ? list.length : index + 1, 0, node);
|
|
138
|
+
next = node.id;
|
|
139
|
+
}
|
|
140
|
+
if (scope === 'main')
|
|
141
|
+
reconcileRows(draft);
|
|
142
|
+
if (!isDraft(draft))
|
|
143
|
+
return false;
|
|
144
|
+
if (this.adding) {
|
|
145
|
+
this.closePicker(scope);
|
|
146
|
+
this.search[scope] = '';
|
|
147
|
+
this.category[scope] = 'all';
|
|
148
|
+
}
|
|
149
|
+
this.draft = draft;
|
|
150
|
+
this.order[scope] = list.map(i => i.id);
|
|
151
|
+
this.selected[scope] = next;
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
categories(scope) {
|
|
155
|
+
return ['all', ...new Set(this.catalog(scope).map(item => item.group))];
|
|
156
|
+
}
|
|
157
|
+
filtered(scope) {
|
|
158
|
+
return this.category[scope] !== 'all' || normalize(this.search[scope]).characters.length > 0;
|
|
159
|
+
}
|
|
160
|
+
chooseCategory(scope, category) {
|
|
161
|
+
if (!this.categories(scope).includes(category))
|
|
162
|
+
return;
|
|
163
|
+
this.category[scope] = category;
|
|
164
|
+
this.filter(scope, this.search[scope]);
|
|
165
|
+
}
|
|
166
|
+
filter(scope, value) {
|
|
167
|
+
this.search[scope] = value;
|
|
168
|
+
const matches = this.matches(scope), selected = matches.find(result => result.item.id === this.selected[scope]);
|
|
169
|
+
if (!selected || selected.match.rank > matches[0].match.rank) {
|
|
170
|
+
this.selected[scope] = matches[0]?.item.id || '';
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
toggle(scope, id) {
|
|
174
|
+
if (this.adding)
|
|
175
|
+
return this.instanceAction(scope, 'add', id);
|
|
176
|
+
const draft = copyDraft(this.draft), node = nodes(draft, scope).find(i => i.id === id);
|
|
177
|
+
if (!node)
|
|
178
|
+
return false;
|
|
179
|
+
node.enabled = !node.enabled;
|
|
180
|
+
if (!isDraft(draft))
|
|
181
|
+
return false;
|
|
182
|
+
this.draft = draft;
|
|
183
|
+
return true;
|
|
184
|
+
}
|
|
185
|
+
move(scope, delta) {
|
|
186
|
+
if (this.adding || this.filtered(scope))
|
|
187
|
+
return false;
|
|
188
|
+
const visible = this.visible(scope).map((item) => item.id);
|
|
189
|
+
const id = this.selected[scope];
|
|
190
|
+
const index = visible.indexOf(id);
|
|
191
|
+
const target = visible[index + delta];
|
|
192
|
+
if (index < 0 || !target)
|
|
193
|
+
return false;
|
|
194
|
+
const draft = copyDraft(this.draft);
|
|
195
|
+
const ordered = nodes(draft, scope);
|
|
196
|
+
const sourceIndex = ordered.findIndex(node => node.id === id);
|
|
197
|
+
const [moving] = ordered.splice(sourceIndex, 1);
|
|
198
|
+
ordered.splice(ordered.findIndex(node => node.id === target) + (delta > 0 ? 1 : 0), 0, moving);
|
|
199
|
+
if (scope === 'main')
|
|
200
|
+
reconcileRows(draft);
|
|
201
|
+
if (!isDraft(draft))
|
|
202
|
+
return false;
|
|
203
|
+
this.draft = draft;
|
|
204
|
+
this.order[scope] = ordered.map(node => node.id);
|
|
205
|
+
return true;
|
|
206
|
+
}
|
|
207
|
+
setBuffer(field, value) {
|
|
208
|
+
this.activeNumeric = field;
|
|
209
|
+
this.buffers[field] = value;
|
|
210
|
+
delete this.fieldErrors[field];
|
|
211
|
+
delete this.fieldErrorMessages[field];
|
|
212
|
+
}
|
|
213
|
+
cancelNumeric(field) {
|
|
214
|
+
for (const key of field ? [field] : NUMERIC_FIELDS) {
|
|
215
|
+
this.buffers[key] = String(this.draft.host[key]);
|
|
216
|
+
delete this.fieldErrors[key];
|
|
217
|
+
delete this.fieldErrorMessages[key];
|
|
218
|
+
}
|
|
219
|
+
if (!field || this.activeNumeric === field)
|
|
220
|
+
this.activeNumeric = null;
|
|
221
|
+
}
|
|
222
|
+
acceptNumeric(field) {
|
|
223
|
+
const values = {};
|
|
224
|
+
const fields = field ? [field] : NUMERIC_FIELDS;
|
|
225
|
+
for (const key of fields) {
|
|
226
|
+
delete this.fieldErrors[key];
|
|
227
|
+
delete this.fieldErrorMessages[key];
|
|
228
|
+
const parsed = numericValue(this.description, key, this.buffers[key]);
|
|
229
|
+
if (parsed.error !== undefined) {
|
|
230
|
+
this.fieldErrors[key] = parsed.error;
|
|
231
|
+
this.fieldErrorMessages[key] = numericDiagnostic(this.description, key);
|
|
232
|
+
}
|
|
233
|
+
else
|
|
234
|
+
values[key] = parsed.value;
|
|
235
|
+
}
|
|
236
|
+
if (fields.some((key) => this.fieldErrors[key]))
|
|
237
|
+
return false;
|
|
238
|
+
if (values.padding !== undefined)
|
|
239
|
+
this.draft.host.padding = values.padding;
|
|
240
|
+
if (values.refresh_interval !== undefined)
|
|
241
|
+
this.draft.host.refresh_interval = values.refresh_interval;
|
|
242
|
+
this.cancelNumeric(field);
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
committed(current) {
|
|
246
|
+
this.baseline = { ...current, draft: copyDraft(current.draft) };
|
|
247
|
+
this.draft = copyDraft(current.draft);
|
|
248
|
+
this.cancelNumeric();
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=draft.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draft.js","sourceRoot":"","sources":["../../../src/editor/draft.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAiB,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAQvC,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAS3D,gFAAgF;AAChF,MAAM,UAAU,SAAS,CAAC,KAAY;IACpC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAU,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAW,EAAE,KAAY;IACjD,OAAO,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC;AAED,kFAAkF;AAClF,MAAM,OAAO,MAAM;IAwBC;IAvBlB,KAAK,CAAQ;IACb,QAAQ,CAAa;IACrB,IAAI,GAAS,MAAM,CAAC;IACpB,QAAQ,GAAG,KAAK,CAAC;IACjB,MAAM,GAAG,KAAK,CAAC;IACf,WAAW,GAA2D,IAAI,CAAC;IAC3E,MAAM,GAAwC,IAAI,CAAC;IACnD,cAAc,GAAkB,IAAI,CAAC;IACrC,MAAM,GAAuB,IAAI,CAAC;IAClC,MAAM,GAAG,SAAS,CAAC;IACnB,IAAI,GAAG,iBAAiB,CAAC;IACzB,eAAe,GAA0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AAI,CAAC,KAAK,CAAC,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAC7D,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QAC1B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,SAAS,CAAC,OAAmB;QAC3B,IAAI,CAAC,QAAQ,GAAG,EAAE,GAAG,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QAChE,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;CAEF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Language, type LocalizedText } from '../i18n/messages.js';
|
|
2
|
+
import type { EditorField } from '../contracts/ui.js';
|
|
3
|
+
import type { Editor } from './draft.js';
|
|
4
|
+
export interface FormView {
|
|
5
|
+
editor: Editor | null;
|
|
6
|
+
language?: Language;
|
|
7
|
+
message: string;
|
|
8
|
+
localized?: {
|
|
9
|
+
message?: LocalizedText;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface SettingRow {
|
|
13
|
+
key: string;
|
|
14
|
+
label: string;
|
|
15
|
+
group: string;
|
|
16
|
+
value: string;
|
|
17
|
+
editable: boolean;
|
|
18
|
+
}
|
|
19
|
+
export declare function fieldMessage(row: SettingRow, view: FormView): LocalizedText;
|
|
20
|
+
export interface FormRow extends SettingRow {
|
|
21
|
+
spec: EditorField;
|
|
22
|
+
valueRaw: unknown;
|
|
23
|
+
}
|
|
24
|
+
export declare function formRows(view: FormView): FormRow[];
|
|
25
|
+
export declare function setFormValue(view: FormView, current: FormRow, raw: string | boolean): boolean;
|
|
26
|
+
export declare function adjustForm(view: FormView, current: FormRow, delta: -1 | 1): void;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { nodes } from './instances.js';
|
|
2
|
+
import { text as localizedText } from '../i18n/messages.js';
|
|
3
|
+
/** Canonical descriptors drive tool forms in both editors. */
|
|
4
|
+
import { ITEM_DEFAULTS } from '../contracts/ui.js';
|
|
5
|
+
import { itemFields, normalizeColor } from './appearance.js';
|
|
6
|
+
import { isDraft } from './backend.js';
|
|
7
|
+
import { copyDraft } from './draft.js';
|
|
8
|
+
function setMessage(view, slot, value) { view.message = value.fallback; (view.localized ??= {}).message = value; }
|
|
9
|
+
export function fieldMessage(row, view) {
|
|
10
|
+
const key = row.key;
|
|
11
|
+
if (key.startsWith('field:'))
|
|
12
|
+
return localizedText('fields.global.' + key.slice(6) + '.label');
|
|
13
|
+
if (key.startsWith('item:'))
|
|
14
|
+
return localizedText('fields.item.' + key.slice(5) + '.label');
|
|
15
|
+
if (key.startsWith('fit:')) {
|
|
16
|
+
const [, id, field] = key.split(':');
|
|
17
|
+
return localizedText('native.fitting_label', { item: view.editor.instanceLabel('main', id, view.language), field: localizedText('fields.item.' + field + '.label') });
|
|
18
|
+
}
|
|
19
|
+
if (key.startsWith('break:'))
|
|
20
|
+
return localizedText('layout.break_before', { item: view.editor.instanceLabel('main', key.slice(6), view.language) });
|
|
21
|
+
return localizedText('native.settings.' + key);
|
|
22
|
+
}
|
|
23
|
+
function read(data, path) {
|
|
24
|
+
return path.split('.').reduce((v, key) => v[key], data);
|
|
25
|
+
}
|
|
26
|
+
function write(data, path, value) {
|
|
27
|
+
const parts = path.split('.');
|
|
28
|
+
const key = parts.pop();
|
|
29
|
+
const target = parts.reduce((v, part) => v[part], data);
|
|
30
|
+
target[key] = value;
|
|
31
|
+
}
|
|
32
|
+
function format(raw) {
|
|
33
|
+
return raw === null ? 'inherit' : typeof raw === 'boolean' ? raw ? 'on' : 'off' : String(raw);
|
|
34
|
+
}
|
|
35
|
+
function row(spec, key, valueRaw) {
|
|
36
|
+
return { ...spec, spec, key, valueRaw, value: format(valueRaw), editable: true };
|
|
37
|
+
}
|
|
38
|
+
export function formRows(view) {
|
|
39
|
+
const e = view.editor;
|
|
40
|
+
const d = e.draft.display;
|
|
41
|
+
if (e.detail) {
|
|
42
|
+
const node = e.instance(e.detail.scope, e.detail.id);
|
|
43
|
+
const options = node.options;
|
|
44
|
+
return itemFields(e.description.editor_fields.item, e.detail.scope, node.type_id).map((spec) => row(spec, 'item:' + spec.key, spec.key === 'text' ? node.text : spec.key in e.description.formatting_options ? options.formatting[spec.key] ?? 'inherit' :
|
|
45
|
+
options[spec.key] ?? ITEM_DEFAULTS[spec.key]))
|
|
46
|
+
.sort((a, b) => ['Item format', 'Conditional visibility', 'Item colors', 'Item fitting'].indexOf(a.group) - ['Item format', 'Conditional visibility', 'Item colors', 'Item fitting'].indexOf(b.group));
|
|
47
|
+
}
|
|
48
|
+
if (e.page === 'layout') {
|
|
49
|
+
const result = [row({ key: 'layout.mode', label: 'Layout mode', group: 'Layout', kind: 'choice', choices: ['auto', 'explicit'], minimum: 0, maximum: 0, nullable: false }, 'layout.mode', d.layout.mode)];
|
|
50
|
+
const starts = new Set(d.layout.rows.slice(1).map((r) => r[0]));
|
|
51
|
+
for (const id of d.instances.map(i => i.id)) {
|
|
52
|
+
const label = e.definition('main', id).label;
|
|
53
|
+
if (id !== d.instances[0]?.id)
|
|
54
|
+
result.push(row({ key: 'break:' + id, label: 'New row before ' + label, group: 'Row boundaries', kind: 'boolean', choices: [], minimum: 0, maximum: 0, nullable: false }, 'break:' + id, starts.has(id)));
|
|
55
|
+
}
|
|
56
|
+
for (const id of d.instances.filter(i => i.type_id !== 'spacer').map(i => i.id)) {
|
|
57
|
+
const label = e.definition('main', id).label;
|
|
58
|
+
for (const name of ['priority', 'max_width']) {
|
|
59
|
+
const spec = e.description.editor_fields.item.find((s) => s.key === name);
|
|
60
|
+
result.push(row({ ...spec, label: label + ' ' + spec.label, group: 'Item fitting' }, 'fit:' + id + ':' + name, e.instance('main', id)?.options[name] ?? (name === 'priority' ? 50 : null)));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return result;
|
|
64
|
+
}
|
|
65
|
+
return e.description.editor_fields.global.map((spec) => row(spec, 'field:' + spec.key, read(d, spec.key)));
|
|
66
|
+
}
|
|
67
|
+
function options(draft, scope, id) {
|
|
68
|
+
return nodes(draft, scope).find(i => i.id === id).options;
|
|
69
|
+
}
|
|
70
|
+
export function setFormValue(view, current, raw) {
|
|
71
|
+
const e = view.editor;
|
|
72
|
+
const spec = current.spec;
|
|
73
|
+
let value = raw;
|
|
74
|
+
if (spec.kind === 'integer') {
|
|
75
|
+
value = spec.nullable && (raw === 'inherit' || raw === 'none') ? null :
|
|
76
|
+
typeof raw === 'string' && /^\d+$/.test(raw) ? Number(raw) : NaN;
|
|
77
|
+
if (value !== null && (!Number.isInteger(value) || Number(value) < spec.minimum || Number(value) > spec.maximum)) {
|
|
78
|
+
setMessage(view, "message", localizedText("native.lib.client.forms.enter", { label: fieldMessage(current, view), minimum: spec.minimum, maximum: spec.maximum, value3: (spec.nullable ? localizedText("native.lib.client.forms.or_none") : localizedText("native.lib.client.forms.detail")) }));
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (spec.kind === 'text')
|
|
83
|
+
value = spec.nullable && raw === 'inherit' ? null : raw;
|
|
84
|
+
else if (spec.kind === 'choice' && !spec.choices.includes(String(raw)))
|
|
85
|
+
return false;
|
|
86
|
+
if (spec.key === "foreground" || spec.key === "background")
|
|
87
|
+
value = normalizeColor(value);
|
|
88
|
+
const draft = copyDraft(e.draft);
|
|
89
|
+
if (current.key === 'layout.mode') {
|
|
90
|
+
draft.display.layout = { mode: value, rows: value === 'explicit' && draft.display.instances.length ? [draft.display.instances.map(i => i.id)] : [] };
|
|
91
|
+
}
|
|
92
|
+
else if (current.key.startsWith('break:')) {
|
|
93
|
+
const starts = new Set(draft.display.layout.rows.slice(1).map((r) => r[0]));
|
|
94
|
+
const id = current.key.slice(6);
|
|
95
|
+
if (value)
|
|
96
|
+
starts.add(id);
|
|
97
|
+
else
|
|
98
|
+
starts.delete(id);
|
|
99
|
+
const rows = [];
|
|
100
|
+
for (const item of draft.display.instances.map(i => i.id)) {
|
|
101
|
+
if (!rows.length || starts.has(item))
|
|
102
|
+
rows.push([]);
|
|
103
|
+
rows[rows.length - 1].push(item);
|
|
104
|
+
}
|
|
105
|
+
draft.display.layout = { mode: 'explicit', rows };
|
|
106
|
+
}
|
|
107
|
+
else if (current.key.startsWith('fit:')) {
|
|
108
|
+
const [, id, key] = current.key.split(':');
|
|
109
|
+
options(draft, 'main', id)[key] = value;
|
|
110
|
+
}
|
|
111
|
+
else if (e.detail) {
|
|
112
|
+
const option = options(draft, e.detail.scope, e.detail.id);
|
|
113
|
+
if (spec.key === "text") {
|
|
114
|
+
nodes(draft, e.detail.scope).find(i => i.id === e.detail.id).text = String(value);
|
|
115
|
+
}
|
|
116
|
+
else if (spec.key in e.description.formatting_options) {
|
|
117
|
+
if (value === 'inherit')
|
|
118
|
+
delete option.formatting[spec.key];
|
|
119
|
+
else
|
|
120
|
+
option.formatting[spec.key] = String(value);
|
|
121
|
+
}
|
|
122
|
+
else
|
|
123
|
+
option[spec.key] = value;
|
|
124
|
+
}
|
|
125
|
+
else
|
|
126
|
+
write(draft.display, spec.key, value);
|
|
127
|
+
if (!isDraft(draft)) {
|
|
128
|
+
setMessage(view, "message", localizedText("native.lib.client.forms.invalid_value_check_thresholds_text_and_width_constraints"));
|
|
129
|
+
return false;
|
|
130
|
+
}
|
|
131
|
+
e.draft = draft;
|
|
132
|
+
return true;
|
|
133
|
+
}
|
|
134
|
+
export function adjustForm(view, current, delta) {
|
|
135
|
+
const spec = current.spec;
|
|
136
|
+
if (spec.kind === 'boolean')
|
|
137
|
+
setFormValue(view, current, !current.valueRaw);
|
|
138
|
+
else if (spec.kind === 'choice') {
|
|
139
|
+
const index = spec.choices.indexOf(String(current.valueRaw));
|
|
140
|
+
setFormValue(view, current, spec.choices[(index + delta + spec.choices.length) % spec.choices.length]);
|
|
141
|
+
}
|
|
142
|
+
else if (spec.kind === 'integer') {
|
|
143
|
+
setFormValue(view, current, String(Math.max(spec.minimum, Math.min(spec.maximum, Number(current.valueRaw ?? spec.minimum) + delta))));
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=forms.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../src/editor/forms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,IAAI,IAAI,aAAa,EAAqC,MAAM,qBAAqB,CAAC;AAC/F,8DAA8D;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAkBvC,SAAS,UAAU,CAAC,IAAc,EAAE,IAAe,EAAE,KAAoB,IAAU,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,EAAE,CAAC,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC;AAC5J,MAAM,UAAU,YAAY,CAAC,GAAe,EAAE,IAAc;IACxD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;IACpB,IAAI,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC;QACxB,OAAO,aAAa,CAAC,gBAAgB,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;IACrE,IAAI,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC;QACvB,OAAO,aAAa,CAAC,cAAc,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC;IACnE,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CA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item, language, width) {
|
|
4
|
+
const guide = item.guidance;
|
|
5
|
+
const tr = (key, params = {}) => t('guidance.' + key, language, params);
|
|
6
|
+
return wrapText([
|
|
7
|
+
t(`items.${item.scope}.${item.id}.label`, language) + ` (${item.scope}:${item.id})`,
|
|
8
|
+
tr('static'), '', tr('scope', { value: tr('scopes.' + guide.measurement_scope) }),
|
|
9
|
+
tr('sources', { value: guide.source_kinds.map(source => tr('sources.' + source)).join(', ') }),
|
|
10
|
+
tr('fields', { value: item.sources.join(', ') }),
|
|
11
|
+
item.minimum_version ? tr('version', { value: item.minimum_version }) : tr('version_unknown'),
|
|
12
|
+
'', tr('requirements'), ...guide.requirements.map(requirement => tr('requirements.' + requirement)),
|
|
13
|
+
'', tr('reasons'), ...item.unavailable_reasons.map(reason => tr('reasons.' + reason)),
|
|
14
|
+
'', tr('setup'), ...guide.setup,
|
|
15
|
+
], width);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=guidance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"guidance.js","sourceRoot":"","sources":["../../../src/editor/guidance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,qBAAqB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,MAAM,UAAU,aAAa,CAAC,IAAiB,EAAE,QAAkB,EAAE,KAAa;IAChF,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC5B,MAAM,EAAE,GAAG,CAAC,GAAW,EAAE,SAAkC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IACzG,OAAO,QAAQ,CAAC;QACd,CAAC,CAAC,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,EAAE,GAAG;QACnF,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,OAAO,EAAE,EAAC,KAAK,EAAC,EAAE,CAAC,SAAS,GAAG,KAAK,CAAC,iBAAiB,CAAC,EAAC,CAAC;QAC9E,EAAE,CAAC,SAAS,EAAE,EAAC,KAAK,EAAE,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,CAAC;QAC5F,EAAE,CAAC,QAAQ,EAAE,EAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAC,CAAC;QAC9C,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,EAAC,KAAK,EAAC,IAAI,CAAC,eAAe,EAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC;QAC1F,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,GAAG,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,EAAE,CAAC,eAAe,GAAG,WAAW,CAAC,CAAC;QACnG,EAAE,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,UAAU,GAAG,MAAM,CAAC,CAAC;QACrF,EAAE,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,KAAK,CAAC,KAAK;KAChC,EAAE,KAAK,CAAC,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ImportReviewResult, Scope } from '../contracts/ui.js';
|
|
2
|
+
import type { Language } from '../i18n/messages.js';
|
|
3
|
+
export declare const REVIEW_SECTIONS: readonly ["main", "subagent", "formatting", "layout", "language", "host"];
|
|
4
|
+
export interface ReviewState {
|
|
5
|
+
result: ImportReviewResult;
|
|
6
|
+
selected: string;
|
|
7
|
+
expanded: string[];
|
|
8
|
+
scroll: number;
|
|
9
|
+
previewScope: Scope;
|
|
10
|
+
}
|
|
11
|
+
export interface ReviewRow {
|
|
12
|
+
text: string;
|
|
13
|
+
section: string;
|
|
14
|
+
heading: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function sections(review: ReviewState): string[];
|
|
17
|
+
export declare function createReview(result: ImportReviewResult): ReviewState;
|
|
18
|
+
export declare function reviewRows(review: ReviewState, language: Language, width: number): ReviewRow[];
|
|
19
|
+
export declare function navigateReview(review: ReviewState, key: string, language: Language, width: number, capacity: number): void;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { renderMessage, t } from '../i18n/messages.js';
|
|
2
|
+
import { wrapText } from './text.js';
|
|
3
|
+
export const REVIEW_SECTIONS = ['main', 'subagent', 'formatting', 'layout', 'language', 'host'];
|
|
4
|
+
export function sections(review) {
|
|
5
|
+
return REVIEW_SECTIONS.filter(section => review.result.changes.some(change => change.section === section));
|
|
6
|
+
}
|
|
7
|
+
export function createReview(result) {
|
|
8
|
+
const review = { result, selected: '', expanded: [], scroll: 0, previewScope: 'main' };
|
|
9
|
+
review.selected = sections(review)[0] ?? '';
|
|
10
|
+
return review;
|
|
11
|
+
}
|
|
12
|
+
export function reviewRows(review, language, width) {
|
|
13
|
+
const rows = [];
|
|
14
|
+
for (const section of sections(review)) {
|
|
15
|
+
const changes = review.result.changes.filter(change => change.section === section);
|
|
16
|
+
rows.push({ section, heading: true, text: `${review.selected === section ? '› ' : ' '}${review.expanded.includes(section) ? '[-]' : '[+]'} ${t('review.sections.' + section, language)} (${changes.length})` });
|
|
17
|
+
if (review.expanded.includes(section))
|
|
18
|
+
for (const change of changes) {
|
|
19
|
+
const paragraphs = [renderMessage(change.label, language),
|
|
20
|
+
t('review.before', language, { value: JSON.stringify(change.before) }),
|
|
21
|
+
t('review.after', language, { value: JSON.stringify(change.after) })];
|
|
22
|
+
rows.push(...wrapText(paragraphs, width).map(text => ({ text, section, heading: false })));
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return rows.length ? rows : [{ text: t('review.empty', language), section: '', heading: false }];
|
|
26
|
+
}
|
|
27
|
+
export function navigateReview(review, key, language, width, capacity) {
|
|
28
|
+
const groups = sections(review);
|
|
29
|
+
let follow = false;
|
|
30
|
+
if (key === 'up' || key === 'down') {
|
|
31
|
+
review.selected = groups[Math.max(0, Math.min(groups.length - 1, groups.indexOf(review.selected) + (key === 'up' ? -1 : 1)))] ?? '';
|
|
32
|
+
follow = true;
|
|
33
|
+
}
|
|
34
|
+
else if (key === 'return' && review.selected) {
|
|
35
|
+
review.expanded = review.expanded.includes(review.selected) ? review.expanded.filter(group => group !== review.selected) : [...review.expanded, review.selected];
|
|
36
|
+
follow = true;
|
|
37
|
+
}
|
|
38
|
+
else if (key === 'tab')
|
|
39
|
+
review.previewScope = review.previewScope === 'main' ? 'subagent' : 'main';
|
|
40
|
+
else if (key === 'pageup')
|
|
41
|
+
review.scroll -= capacity;
|
|
42
|
+
else if (key === 'pagedown')
|
|
43
|
+
review.scroll += capacity;
|
|
44
|
+
else if (key === 'home')
|
|
45
|
+
review.scroll = 0;
|
|
46
|
+
else if (key === 'end')
|
|
47
|
+
review.scroll = Number.MAX_SAFE_INTEGER;
|
|
48
|
+
const rows = reviewRows(review, language, width);
|
|
49
|
+
if (follow)
|
|
50
|
+
review.scroll = Math.max(0, rows.findIndex(row => row.heading && row.section === review.selected));
|
|
51
|
+
review.scroll = Math.max(0, Math.min(Math.max(0, rows.length - capacity), review.scroll));
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=import-review.js.map
|