@fbincon/claude-code-statusline 3.1.3 → 3.2.0

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.
Files changed (131) hide show
  1. package/README.md +73 -68
  2. package/candidate.json +243 -191
  3. package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.d.ts +1 -2
  4. package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js +2 -16
  5. package/node_modules/@fbincon/statusline-cli/dist/src/config/backend-preferences.js.map +1 -1
  6. package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js +2 -1
  7. package/node_modules/@fbincon/statusline-cli/dist/src/config/commands.js.map +1 -1
  8. package/node_modules/@fbincon/statusline-cli/dist/src/config/runtime-preferences.d.ts +3 -0
  9. package/node_modules/@fbincon/statusline-cli/dist/src/config/runtime-preferences.js +42 -0
  10. package/node_modules/@fbincon/statusline-cli/dist/src/config/runtime-preferences.js.map +1 -0
  11. package/node_modules/@fbincon/statusline-cli/dist/src/main.js +6 -1
  12. package/node_modules/@fbincon/statusline-cli/dist/src/main.js.map +1 -1
  13. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/environment.js +1 -1
  14. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js +3 -1
  15. package/node_modules/@fbincon/statusline-cli/dist/src/rendering/preview.js.map +1 -1
  16. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/command.d.ts +3 -0
  17. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/command.js +35 -0
  18. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/command.js.map +1 -0
  19. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/collect.js +1 -1
  20. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/live/protocol.js +1 -1
  21. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage-index.d.ts +6 -1
  22. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage-index.js +44 -4
  23. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage-index.js.map +1 -1
  24. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.d.ts +1 -0
  25. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js +3 -1
  26. package/node_modules/@fbincon/statusline-cli/dist/src/runtime/usage.js.map +1 -1
  27. package/node_modules/@fbincon/statusline-cli/dist/src/ui/explain.d.ts +4 -0
  28. package/node_modules/@fbincon/statusline-cli/dist/src/ui/explain.js +27 -0
  29. package/node_modules/@fbincon/statusline-cli/dist/src/ui/explain.js.map +1 -0
  30. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.d.ts +4 -3
  31. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js +12 -2
  32. package/node_modules/@fbincon/statusline-cli/dist/src/ui/protocol.js.map +1 -1
  33. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/.claude-plugin/plugin.json +1 -1
  34. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/hooks/register.ts +12 -9
  35. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/backend.ts +16 -2
  36. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/keys.ts +35 -19
  37. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/messages.ts +12 -8
  38. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/client/settings.ts +2 -1
  39. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/draft.ts +5 -0
  40. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/explanation.ts +35 -0
  41. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/quick-setup.ts +82 -0
  42. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/editor/text-input.ts +68 -0
  43. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/generated-contracts.ts +26 -4
  44. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/i18n/generated-locales.ts +450 -6
  45. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/lib/session.ts +7 -4
  46. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/resource-manifest.json +19 -16
  47. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/draw.ts +25 -6
  48. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/help.ts +6 -3
  49. package/node_modules/@fbincon/statusline-cli/resources/statusline-native/ui/client/surface.ts +16 -3
  50. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/.claude-plugin/plugin.json +1 -1
  51. package/node_modules/@fbincon/statusline-cli/resources/statusline-runtime/resource-manifest.json +3 -3
  52. package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js +1 -2
  53. package/node_modules/@fbincon/statusline-core/dist/src/config/backend-preferences.js.map +1 -1
  54. package/node_modules/@fbincon/statusline-core/dist/src/config/display.d.ts +1 -1
  55. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js +1 -8
  56. package/node_modules/@fbincon/statusline-core/dist/src/config/display.js.map +1 -1
  57. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.d.ts +7 -0
  58. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js +5 -0
  59. package/node_modules/@fbincon/statusline-core/dist/src/config/presets.js.map +1 -1
  60. package/node_modules/@fbincon/statusline-core/dist/src/config/validation.d.ts +1 -0
  61. package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js +9 -1
  62. package/node_modules/@fbincon/statusline-core/dist/src/config/validation.js.map +1 -1
  63. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.d.ts +31 -13
  64. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js +1 -1
  65. package/node_modules/@fbincon/statusline-core/dist/src/contracts/generated-catalog.js.map +1 -1
  66. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.d.ts +65 -16
  67. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js +3 -1
  68. package/node_modules/@fbincon/statusline-core/dist/src/contracts/ui.js.map +1 -1
  69. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js +21 -2
  70. package/node_modules/@fbincon/statusline-core/dist/src/editor/backend.js.map +1 -1
  71. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.d.ts +4 -0
  72. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js +3 -0
  73. package/node_modules/@fbincon/statusline-core/dist/src/editor/draft.js.map +1 -1
  74. package/node_modules/@fbincon/statusline-core/dist/src/editor/explanation.d.ts +13 -0
  75. package/node_modules/@fbincon/statusline-core/dist/src/editor/explanation.js +41 -0
  76. package/node_modules/@fbincon/statusline-core/dist/src/editor/explanation.js.map +1 -0
  77. package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.d.ts +21 -0
  78. package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.js +105 -0
  79. package/node_modules/@fbincon/statusline-core/dist/src/editor/quick-setup.js.map +1 -0
  80. package/node_modules/@fbincon/statusline-core/dist/src/editor/text-input.d.ts +32 -0
  81. package/node_modules/@fbincon/statusline-core/dist/src/editor/text-input.js +89 -0
  82. package/node_modules/@fbincon/statusline-core/dist/src/editor/text-input.js.map +1 -0
  83. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.d.ts +444 -0
  84. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js +450 -6
  85. package/node_modules/@fbincon/statusline-core/dist/src/i18n/generated-locales.js.map +1 -1
  86. package/node_modules/@fbincon/statusline-core/dist/src/release.d.ts +1 -1
  87. package/node_modules/@fbincon/statusline-core/dist/src/release.js +1 -1
  88. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.d.ts +3 -2
  89. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js +8 -3
  90. package/node_modules/@fbincon/statusline-core/dist/src/rendering/components.js.map +1 -1
  91. package/node_modules/@fbincon/statusline-core/dist/src/rendering/context.d.ts +2 -0
  92. package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.d.ts +14 -0
  93. package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js +37 -0
  94. package/node_modules/@fbincon/statusline-core/dist/src/rendering/explain.js.map +1 -0
  95. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js +22 -7
  96. package/node_modules/@fbincon/statusline-core/dist/src/rendering/items.js.map +1 -1
  97. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.d.ts +3 -1
  98. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js +7 -2
  99. package/node_modules/@fbincon/statusline-core/dist/src/rendering/powerline.js.map +1 -1
  100. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js +1 -0
  101. package/node_modules/@fbincon/statusline-core/dist/src/rendering/preview.js.map +1 -1
  102. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js +35 -12
  103. package/node_modules/@fbincon/statusline-core/dist/src/rendering/subagents.js.map +1 -1
  104. package/node_modules/@fbincon/statusline-core/dist/src/rendering/trace.d.ts +13 -0
  105. package/node_modules/@fbincon/statusline-core/dist/src/rendering/trace.js +35 -0
  106. package/node_modules/@fbincon/statusline-core/dist/src/rendering/trace.js.map +1 -0
  107. package/node_modules/@fbincon/statusline-core/dist/src/terminal/key.d.ts +2 -0
  108. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/en.json +75 -1
  109. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ja.json +75 -1
  110. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/ko.json +75 -1
  111. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-CN.json +75 -1
  112. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-HK.json +75 -1
  113. package/node_modules/@fbincon/statusline-core/resources/i18n/locales/zh-TW.json +75 -1
  114. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.d.ts +2 -0
  115. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js +11 -3
  116. package/node_modules/@fbincon/statusline-platform/dist/src/terminal/input.js.map +1 -1
  117. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js +15 -1
  118. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/pages.js.map +1 -1
  119. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js +4 -0
  120. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/presentation.js.map +1 -1
  121. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js +15 -5
  122. package/node_modules/@fbincon/statusline-tui/dist/src/drawing/shortcuts.js.map +1 -1
  123. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js +3 -3
  124. package/node_modules/@fbincon/statusline-tui/dist/src/drawing.js.map +1 -1
  125. package/node_modules/@fbincon/statusline-tui/dist/src/session.d.ts +1 -0
  126. package/node_modules/@fbincon/statusline-tui/dist/src/session.js +40 -3
  127. package/node_modules/@fbincon/statusline-tui/dist/src/session.js.map +1 -1
  128. package/node_modules/@fbincon/statusline-tui/dist/src/state.d.ts +6 -2
  129. package/node_modules/@fbincon/statusline-tui/dist/src/state.js +87 -40
  130. package/node_modules/@fbincon/statusline-tui/dist/src/state.js.map +1 -1
  131. package/package.json +1 -1
@@ -0,0 +1,105 @@
1
+ import { THEME_VALUES, PALETTE_VALUES, SEPARATORSTYLE_VALUES, PRESETS } from '../contracts/ui.js';
2
+ import { copyDraft } from './draft.js';
3
+ import { t } from '../i18n/messages.js';
4
+ import { wrapText } from './text.js';
5
+ export function openQuick(draft) {
6
+ return { base: copyDraft(draft), candidate: copyDraft(draft), step: 'scenario', selected: 0, preset: 'developer', previewScope: 'main', detailScroll: 0 };
7
+ }
8
+ export function receivePreset(quick, draft) {
9
+ quick.candidate = copyDraft(draft);
10
+ quick.step = 'appearance';
11
+ quick.selected = 0;
12
+ quick.detailScroll = 0;
13
+ }
14
+ export function quickKey(quick, key) {
15
+ const count = quick.step === 'scenario' ? PRESETS.length : quick.step === 'appearance' ? 5 : 3;
16
+ if (key === 'escape' || key === 'cancel')
17
+ return 'cancel';
18
+ if (key === 'pageup' || key === 'pagedown') {
19
+ quick.detailScroll = Math.max(0, quick.detailScroll + (key === 'pageup' ? -1 : 1));
20
+ return null;
21
+ }
22
+ if (key === 'tab') {
23
+ quick.previewScope = quick.previewScope === 'main' ? 'subagent' : 'main';
24
+ return null;
25
+ }
26
+ if (key === 'backspace' || quick.step === 'review' && quick.selected === 2 && key === 'return') {
27
+ if (quick.step === 'scenario')
28
+ return 'cancel';
29
+ quick.step = quick.step === 'review' ? 'appearance' : 'scenario';
30
+ quick.selected = quick.step === 'scenario' ? Math.max(0, PRESETS.findIndex(p => p.id === quick.preset)) : 0;
31
+ quick.detailScroll = 0;
32
+ return null;
33
+ }
34
+ if (key === 'up' || key === 'down' || key === 'home' || key === 'end') {
35
+ quick.selected = key === 'home' ? 0 : key === 'end' ? count - 1 : Math.max(0, Math.min(count - 1, quick.selected + (key === 'up' ? -1 : 1)));
36
+ quick.detailScroll = 0;
37
+ return null;
38
+ }
39
+ if (quick.step === 'scenario' && key === 'return') {
40
+ quick.preset = PRESETS[quick.selected].id;
41
+ return 'preset';
42
+ }
43
+ if (quick.step === 'review' && key === 'return')
44
+ return quick.selected === 0 ? 'accept' : 'save';
45
+ if (quick.step !== 'appearance' || !['left', 'right', 'return'].includes(key))
46
+ return null;
47
+ const d = quick.candidate.display, delta = key === 'left' ? -1 : 1;
48
+ const cycle = (values, value) => values[(values.indexOf(value) + delta + values.length) % values.length];
49
+ if (quick.selected === 0)
50
+ d.theme = cycle(THEME_VALUES, d.theme);
51
+ if (quick.selected === 1)
52
+ d.use_colors = !d.use_colors;
53
+ if (quick.selected === 2)
54
+ d.palette = cycle(PALETTE_VALUES, d.palette);
55
+ if (quick.selected === 3)
56
+ d.separator_style = cycle(SEPARATORSTYLE_VALUES, d.separator_style);
57
+ if (quick.selected === 4 && key === 'return') {
58
+ quick.step = 'review';
59
+ quick.selected = 0;
60
+ quick.detailScroll = 0;
61
+ }
62
+ return null;
63
+ }
64
+ /** Both adapters use the same menu, selection window and scrollable requirement text. */
65
+ export function quickView(quick, language, width, height) {
66
+ const tr = (key, params = {}) => t(key, language, params);
67
+ const preset = PRESETS.find(p => p.id === (quick.step === 'scenario' ? PRESETS[quick.selected].id : quick.preset));
68
+ const d = quick.candidate.display;
69
+ const rows = quick.step === 'scenario' ? PRESETS.map(p => (p.example ? tr('quick.example') + ': ' : '') + tr('quick.purpose.' + p.id))
70
+ : quick.step === 'appearance' ? [
71
+ tr('fields.global.theme.label') + ': ' + tr('values.' + d.theme),
72
+ tr('settings.colors') + ': ' + tr('values.' + (d.use_colors ? 'on' : 'off')),
73
+ tr('settings.palette') + ': ' + d.palette,
74
+ tr('settings.separator-style') + ': ' + tr('values.' + d.separator_style), tr('quick.next'),
75
+ ] : [tr('quick.fine_tune'), tr('quick.save'), tr('quick.back')];
76
+ const paragraphs = [tr(preset.requirements_key), tr('quick.sample'),
77
+ ...(!d.subagents.enabled && preset.id === 'multi-agent' ? [tr('quick.subagents_off')] : []),
78
+ ...(quick.step === 'review' ? [tr('quick.replace')] : [])];
79
+ const detail = wrapText(paragraphs, width), menuHeight = Math.max(1, Math.min(rows.length, Math.floor(height / 2)));
80
+ const start = Math.max(0, Math.min(quick.selected, rows.length - menuHeight, quick.selected - menuHeight + 1));
81
+ const result = rows.slice(start, start + menuHeight).map((text, index) => ({ text: (start + index === quick.selected ? '› ' : ' ') + text, selected: start + index === quick.selected }));
82
+ const capacity = Math.max(0, height - result.length), offset = Math.min(quick.detailScroll, Math.max(0, detail.length - capacity));
83
+ result.push(...detail.slice(offset, offset + capacity).map(text => ({ text, selected: false })));
84
+ return result;
85
+ }
86
+ export function controlQuick(editor, key) {
87
+ const quick = editor.quick;
88
+ if (!quick)
89
+ return null;
90
+ const effect = quickKey(quick, key);
91
+ if (effect === 'cancel')
92
+ editor.quick = null;
93
+ if (effect === 'preset') {
94
+ editor.preset = quick.preset;
95
+ editor.pendingTransfer = 'preset';
96
+ return 'transfer';
97
+ }
98
+ if (effect === 'accept' || effect === 'save') {
99
+ editor.replaceDraft(quick.candidate);
100
+ editor.quick = null;
101
+ return effect === 'save' ? 'save' : null;
102
+ }
103
+ return null;
104
+ }
105
+ //# sourceMappingURL=quick-setup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quick-setup.js","sourceRoot":"","sources":["../../../src/editor/quick-setup.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,CAAC,EAAiB,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAWrC,MAAM,UAAU,SAAS,CAAC,KAAY;IACpC,OAAO,EAAC,IAAI,EAAC,SAAS,CAAC,KAAK,CAAC,EAAC,SAAS,EAAC,SAAS,CAAC,KAAK,CAAC,EAAC,IAAI,EAAC,UAAU,EAAC,QAAQ,EAAC,CAAC,EAAC,MAAM,EAAC,WAAW,EAAC,YAAY,EAAC,MAAM,EAAC,YAAY,EAAC,CAAC,EAAC,CAAC;AAC7I,CAAC;AACD,MAAM,UAAU,aAAa,CAAC,KAAiB,EAAE,KAAY;IAC3D,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;IAAC,KAAK,CAAC,IAAI,GAAG,YAAY,CAAC;IAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,CAAC;IAAC,KAAK,CAAC,YAAY,GAAG,CAAC,CAAC;AAC5G,CAAC;AACD,MAAM,UAAU,QAAQ,CAAC,KAAiB,EAAE,GAAW;IACrD,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,C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ACd,CAAC"}
@@ -0,0 +1,32 @@
1
+ /** Offsets always lie on extended-grapheme boundaries; values retain their original bytes. */
2
+ export interface TextInput {
3
+ value: string;
4
+ cursor: number;
5
+ scroll: number;
6
+ }
7
+ export interface TextKey {
8
+ key: string;
9
+ ctrl?: boolean;
10
+ meta?: boolean;
11
+ paste?: boolean;
12
+ text?: boolean;
13
+ overflow?: boolean;
14
+ }
15
+ export type TextAction = {
16
+ kind: 'insert';
17
+ value: string;
18
+ } | {
19
+ kind: 'left' | 'right' | 'home' | 'end' | 'backspace' | 'delete' | 'clear';
20
+ };
21
+ export declare function textInput(value: string): TextInput;
22
+ export declare function textAction(event: TextKey): TextAction | null;
23
+ export declare function editText(state: TextInput, action: TextAction, limit: number): {
24
+ state: TextInput;
25
+ error?: 'invalid' | 'limit';
26
+ };
27
+ export declare function inputKey(value: string, previous: TextInput | undefined, event: TextKey, limit: number): {
28
+ state: TextInput;
29
+ error?: "invalid" | "limit";
30
+ };
31
+ /** A visible caret takes one cell; resize only adjusts the viewport, never the value. */
32
+ export declare function inputView(state: TextInput, width: number): string;
@@ -0,0 +1,89 @@
1
+ import { graphemes, displayWidth } from '../unicode/index.js';
2
+ export function textInput(value) { return { value, cursor: value.length, scroll: 0 }; }
3
+ function boundaries(value) {
4
+ let position = 0;
5
+ return [0, ...graphemes(value).map(cluster => position += cluster.length)];
6
+ }
7
+ export function textAction(event) {
8
+ if (event.paste || event.text)
9
+ return { kind: 'insert', value: event.key };
10
+ if (event.meta)
11
+ return null;
12
+ if (event.ctrl)
13
+ return event.key.toLowerCase() === 'u' ? { kind: 'clear' } : null;
14
+ if (['left', 'right', 'home', 'end', 'backspace', 'delete'].includes(event.key))
15
+ return { kind: event.key };
16
+ return [...event.key].length === 1 ? { kind: 'insert', value: event.key } : null;
17
+ }
18
+ export function editText(state, action, limit) {
19
+ const points = boundaries(state.value), index = Math.max(0, points.indexOf(state.cursor));
20
+ let value = state.value, cursor = points[index];
21
+ switch (action.kind) {
22
+ case 'home':
23
+ cursor = 0;
24
+ break;
25
+ case 'end':
26
+ cursor = value.length;
27
+ break;
28
+ case 'left':
29
+ cursor = points[Math.max(0, index - 1)];
30
+ break;
31
+ case 'right':
32
+ cursor = points[Math.min(points.length - 1, index + 1)];
33
+ break;
34
+ case 'clear':
35
+ value = '';
36
+ cursor = 0;
37
+ break;
38
+ case 'backspace': {
39
+ const before = points[Math.max(0, index - 1)];
40
+ value = value.slice(0, before) + value.slice(cursor);
41
+ cursor = before;
42
+ break;
43
+ }
44
+ case 'delete':
45
+ value = value.slice(0, cursor) + value.slice(points[Math.min(points.length - 1, index + 1)]);
46
+ break;
47
+ case 'insert':
48
+ if (/[\p{Cc}\p{Cs}\p{Zl}\p{Zp}]/u.test(action.value))
49
+ return { state, error: 'invalid' };
50
+ value = value.slice(0, cursor) + action.value + value.slice(cursor);
51
+ if ([...value].length > limit)
52
+ return { state, error: 'limit' };
53
+ cursor += action.value.length;
54
+ break;
55
+ }
56
+ // Insertion/deletion can join adjacent clusters (combining marks, flags or ZWJ).
57
+ cursor = boundaries(value).find(point => point >= cursor) ?? value.length;
58
+ return { state: { value, cursor, scroll: Math.min(state.scroll, cursor) } };
59
+ }
60
+ export function inputKey(value, previous, event, limit) {
61
+ const state = previous?.value === value ? previous : textInput(value), action = textAction(event);
62
+ return action ? editText(state, action, limit) : { state };
63
+ }
64
+ /** A visible caret takes one cell; resize only adjusts the viewport, never the value. */
65
+ export function inputView(state, width) {
66
+ width = Math.max(1, Math.trunc(width));
67
+ const points = boundaries(state.value);
68
+ let start = points.includes(state.scroll) ? Math.min(state.scroll, state.cursor) : 0;
69
+ while (start < state.cursor && displayWidth(state.value.slice(start, state.cursor)) + 1 > width)
70
+ start = points[points.indexOf(start) + 1];
71
+ state.scroll = start;
72
+ let output = '', used = 0;
73
+ for (let index = points.indexOf(start); index < points.length; index++) {
74
+ const point = points[index];
75
+ if (point === state.cursor) {
76
+ output += '▏';
77
+ used++;
78
+ }
79
+ if (index === points.length - 1)
80
+ break;
81
+ const cluster = state.value.slice(point, points[index + 1]), cells = displayWidth(cluster);
82
+ if (used + cells > width)
83
+ break;
84
+ output += cluster;
85
+ used += cells;
86
+ }
87
+ return output;
88
+ }
89
+ //# sourceMappingURL=text-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text-input.js","sourceRoot":"","sources":["../../../src/editor/text-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAM9D,MAAM,UAAU,SAAS,CAAC,KAAa,IAAe,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AAC1G,SAAS,UAAU,CAAC,KAAa;IAC/B,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,OAAO,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;AAC7E,CAAC;AACD,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,IAAI,KAAK,CAAC,KAAK,IAAI,KAAK,CAAC,IAAI;QAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC;IAC3E,IAAI,KAAK,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC;IAC5B,IAAI,KAAK,CAAC,IAAI;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAClF,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7E,O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