@reliverse/relinka 1.1.4 → 1.1.6

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 (118) hide show
  1. package/dist-npm/components/anykey/index.js +77 -57
  2. package/dist-npm/components/block/block.js +61 -48
  3. package/dist-npm/components/checkbox/index.js +211 -178
  4. package/dist-npm/components/confirm/confirm-main.js +122 -86
  5. package/dist-npm/components/confirm/confirm-three.js +27 -24
  6. package/dist-npm/components/confirm/index.js +45 -36
  7. package/dist-npm/components/core/Separator.js +17 -15
  8. package/dist-npm/components/core/create-prompt.js +124 -101
  9. package/dist-npm/components/core/errors.js +15 -19
  10. package/dist-npm/components/core/hook-engine.js +120 -91
  11. package/dist-npm/components/core/index.js +12 -12
  12. package/dist-npm/components/core/key.js +6 -16
  13. package/dist-npm/components/core/lines.js +54 -45
  14. package/dist-npm/components/core/make-theme.js +30 -21
  15. package/dist-npm/components/core/position.js +23 -27
  16. package/dist-npm/components/core/promise-polyfill.js +14 -11
  17. package/dist-npm/components/core/screen-manager.js +74 -59
  18. package/dist-npm/components/core/theme.js +32 -22
  19. package/dist-npm/components/core/use-effect.js +15 -9
  20. package/dist-npm/components/core/use-keypress.js +23 -19
  21. package/dist-npm/components/core/use-memo.js +16 -10
  22. package/dist-npm/components/core/use-pagination.js +32 -33
  23. package/dist-npm/components/core/use-prefix.js +38 -40
  24. package/dist-npm/components/core/use-ref.js +5 -2
  25. package/dist-npm/components/core/use-state.js +23 -15
  26. package/dist-npm/components/core/useKeyPress.js +17 -14
  27. package/dist-npm/components/core/usePromptState.js +14 -8
  28. package/dist-npm/components/core/utils.js +16 -7
  29. package/dist-npm/components/date/date.js +204 -168
  30. package/dist-npm/components/editor/index.js +92 -71
  31. package/dist-npm/components/expand/index.js +124 -96
  32. package/dist-npm/components/figures/index.js +294 -283
  33. package/dist-npm/components/input/index.js +87 -61
  34. package/dist-npm/components/input/text-main.js +124 -86
  35. package/dist-npm/components/input/text.js +28 -24
  36. package/dist-npm/components/instance/basic.js +25 -17
  37. package/dist-npm/components/instance/browser.js +18 -14
  38. package/dist-npm/components/instance/reporter/basic.js +65 -46
  39. package/dist-npm/components/instance/reporter/browser.js +47 -44
  40. package/dist-npm/components/instance/reporter/fancy.js +96 -83
  41. package/dist-npm/components/instance/shared.js +2 -2
  42. package/dist-npm/components/mono/mono.js +62 -52
  43. package/dist-npm/components/mono/monoTwo.js +49 -35
  44. package/dist-npm/components/multiselect/group-multiselect.js +71 -55
  45. package/dist-npm/components/multiselect/multi-select-two.js +130 -98
  46. package/dist-npm/components/multiselect/multi-select.js +49 -43
  47. package/dist-npm/components/multiselect/multiselect-main.js +146 -120
  48. package/dist-npm/components/multiselect/num-multi-select.js +130 -98
  49. package/dist-npm/components/multiselect/num-multiselect-main.js +35 -24
  50. package/dist-npm/components/next-steps/next-steps.js +25 -24
  51. package/dist-npm/components/number/index.js +112 -78
  52. package/dist-npm/components/number/number-main.js +2 -96
  53. package/dist-npm/components/password/index.js +73 -54
  54. package/dist-npm/components/password/password-main.js +2 -120
  55. package/dist-npm/components/password/password-three.js +30 -26
  56. package/dist-npm/components/progressbar/ProgressBar.js +64 -45
  57. package/dist-npm/components/progressbar/helper.js +40 -33
  58. package/dist-npm/components/progressbar/index.js +1 -1
  59. package/dist-npm/components/prompts/create.js +44 -29
  60. package/dist-npm/components/prompts/index.js +45 -45
  61. package/dist-npm/components/prompts/prompt.js +260 -211
  62. package/dist-npm/components/prompts/promptTwo.js +605 -561
  63. package/dist-npm/components/prompts/relinka.js +295 -237
  64. package/dist-npm/components/range/range.js +294 -247
  65. package/dist-npm/components/rawlist/index.js +107 -87
  66. package/dist-npm/components/results/results.js +37 -31
  67. package/dist-npm/components/search/index.js +193 -148
  68. package/dist-npm/components/select/index.js +186 -148
  69. package/dist-npm/components/select/num-select-main.js +27 -27
  70. package/dist-npm/components/select/num-select.js +5 -125
  71. package/dist-npm/components/select/select-key.js +25 -24
  72. package/dist-npm/components/select/select-main.js +133 -109
  73. package/dist-npm/components/select/select-three.js +36 -32
  74. package/dist-npm/components/select/select-two.js +87 -95
  75. package/dist-npm/components/spinner/index.js +136 -107
  76. package/dist-npm/components/st-end/end.d.ts +1 -1
  77. package/dist-npm/components/st-end/end.js +26 -35
  78. package/dist-npm/components/st-end/start.d.ts +1 -1
  79. package/dist-npm/components/st-end/start.js +15 -30
  80. package/dist-npm/components/toggle/index.js +137 -113
  81. package/dist-npm/components/visual/animate/animate.js +10 -53
  82. package/dist-npm/components/visual/ascii-art/ascii-art.js +1 -12
  83. package/dist-npm/mod.js +2 -1
  84. package/dist-npm/testing/index.js +83 -58
  85. package/dist-npm/types/general.d.ts +2 -1
  86. package/dist-npm/types/general.js +1 -0
  87. package/dist-npm/types/index.js +3 -2
  88. package/dist-npm/types/keypress.js +36 -35
  89. package/dist-npm/types/readline.js +1 -0
  90. package/dist-npm/types/relinka.js +1 -0
  91. package/dist-npm/types/utils.js +1 -0
  92. package/dist-npm/utils/box.js +137 -135
  93. package/dist-npm/utils/color.js +74 -65
  94. package/dist-npm/utils/colorize.js +156 -124
  95. package/dist-npm/utils/component.js +657 -532
  96. package/dist-npm/utils/constants.js +63 -64
  97. package/dist-npm/utils/core.js +3 -2
  98. package/dist-npm/utils/decoder.js +223 -244
  99. package/dist-npm/utils/error.js +9 -4
  100. package/dist-npm/utils/errors.js +4 -14
  101. package/dist-npm/utils/format.js +24 -19
  102. package/dist-npm/utils/keypress.js +414 -316
  103. package/dist-npm/utils/log.js +15 -11
  104. package/dist-npm/utils/mapping.js +52 -45
  105. package/dist-npm/utils/messages.js +183 -183
  106. package/dist-npm/utils/platforms.js +20 -16
  107. package/dist-npm/utils/prompt-tmp.js +286 -235
  108. package/dist-npm/utils/prompt-two.js +286 -235
  109. package/dist-npm/utils/readline.js +7 -5
  110. package/dist-npm/utils/skeleton.js +170 -130
  111. package/dist-npm/utils/stream.js +2 -2
  112. package/dist-npm/utils/string.js +58 -44
  113. package/dist-npm/utils/terminal.js +34 -23
  114. package/dist-npm/utils/tree.js +41 -30
  115. package/dist-npm/utils/types.js +1 -0
  116. package/dist-npm/utils/utils.js +8 -8
  117. package/dist-npm/utils/variants.js +44 -36
  118. package/package.json +20 -28
@@ -1,299 +1,310 @@
1
- import process from "node:process";
1
+ import process from 'node:process';
2
+
2
3
  function isUnicodeSupported() {
3
- if (process.platform !== "win32") {
4
- return process.env.TERM !== "linux";
5
- }
6
- return Boolean(process.env.WT_SESSION) ||
7
- Boolean(process.env.TERMINUS_SUBLIME) ||
8
- process.env.ConEmuTask === "{cmd::Cmder}" ||
9
- process.env.TERM_PROGRAM === "Terminus-Sublime" || process.env.TERM_PROGRAM === "vscode" || process.env.TERM === "xterm-256color" || process.env.TERM === "alacritty" || process.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
4
+ if (process.platform !== 'win32') {
5
+ return process.env.TERM !== 'linux';
6
+ }
7
+
8
+ return process.env.WT_SESSION || Boolean(process.env.TERMINUS_SUBLIME) || process.env.ConEmuTask === '{cmd::Cmder}' || process.env.TERM_PROGRAM === 'Terminus-Sublime' || process.env.TERM_PROGRAM === 'vscode' || process.env.TERM === 'xterm-256color' || process.env.TERM === 'alacritty' || process.env.TERMINAL_EMULATOR === 'JetBrains-JediTerm';
10
9
  }
10
+
11
11
  const common = {
12
- circleQuestionMark: "(?)",
13
- questionMarkPrefix: "(?)",
14
- square: "\u2588",
15
- squareDarkShade: "\u2593",
16
- squareMediumShade: "\u2592",
17
- squareLightShade: "\u2591",
18
- squareTop: "\u2580",
19
- squareBottom: "\u2584",
20
- squareLeft: "\u258C",
21
- squareRight: "\u2590",
22
- squareCenter: "\u25A0",
23
- bullet: "\u25CF",
24
- dot: "\u2024",
25
- ellipsis: "\u2026",
26
- pointerSmall: "\u203A",
27
- triangleUp: "\u25B2",
28
- triangleUpSmall: "\u25B4",
29
- triangleDown: "\u25BC",
30
- triangleDownSmall: "\u25BE",
31
- triangleLeftSmall: "\u25C2",
32
- triangleRightSmall: "\u25B8",
33
- home: "\u2302",
34
- heart: "\u2665",
35
- musicNote: "\u266A",
36
- musicNoteBeamed: "\u266B",
37
- arrowUp: "\u2191",
38
- arrowDown: "\u2193",
39
- arrowLeft: "\u2190",
40
- arrowRight: "\u2192",
41
- arrowLeftRight: "\u2194",
42
- arrowUpDown: "\u2195",
43
- almostEqual: "\u2248",
44
- notEqual: "\u2260",
45
- lessOrEqual: "\u2264",
46
- greaterOrEqual: "\u2265",
47
- identical: "\u2261",
48
- infinity: "\u221E",
49
- subscriptZero: "\u2080",
50
- subscriptOne: "\u2081",
51
- subscriptTwo: "\u2082",
52
- subscriptThree: "\u2083",
53
- subscriptFour: "\u2084",
54
- subscriptFive: "\u2085",
55
- subscriptSix: "\u2086",
56
- subscriptSeven: "\u2087",
57
- subscriptEight: "\u2088",
58
- subscriptNine: "\u2089",
59
- oneHalf: "\xBD",
60
- oneThird: "\u2153",
61
- oneQuarter: "\xBC",
62
- oneFifth: "\u2155",
63
- oneSixth: "\u2159",
64
- oneEighth: "\u215B",
65
- twoThirds: "\u2154",
66
- twoFifths: "\u2156",
67
- threeQuarters: "\xBE",
68
- threeFifths: "\u2157",
69
- threeEighths: "\u215C",
70
- fourFifths: "\u2158",
71
- fiveSixths: "\u215A",
72
- fiveEighths: "\u215D",
73
- sevenEighths: "\u215E",
74
- line: "\u2500",
75
- lineBold: "\u2501",
76
- lineDouble: "\u2550",
77
- lineDashed0: "\u2504",
78
- lineDashed1: "\u2505",
79
- lineDashed2: "\u2508",
80
- lineDashed3: "\u2509",
81
- lineDashed4: "\u254C",
82
- lineDashed5: "\u254D",
83
- lineDashed6: "\u2574",
84
- lineDashed7: "\u2576",
85
- lineDashed8: "\u2578",
86
- lineDashed9: "\u257A",
87
- lineDashed10: "\u257C",
88
- lineDashed11: "\u257E",
89
- lineDashed12: "\u2212",
90
- lineDashed13: "\u2013",
91
- lineDashed14: "\u2010",
92
- lineDashed15: "\u2043",
93
- lineVertical: "\u2502",
94
- lineVerticalBold: "\u2503",
95
- lineVerticalDouble: "\u2551",
96
- lineVerticalDashed0: "\u2506",
97
- lineVerticalDashed1: "\u2507",
98
- lineVerticalDashed2: "\u250A",
99
- lineVerticalDashed3: "\u250B",
100
- lineVerticalDashed4: "\u254E",
101
- lineVerticalDashed5: "\u254F",
102
- lineVerticalDashed6: "\u2575",
103
- lineVerticalDashed7: "\u2577",
104
- lineVerticalDashed8: "\u2579",
105
- lineVerticalDashed9: "\u257B",
106
- lineVerticalDashed10: "\u257D",
107
- lineVerticalDashed11: "\u257F",
108
- lineDownLeft: "\u2510",
109
- lineDownLeftArc: "\u256E",
110
- lineDownBoldLeftBold: "\u2513",
111
- lineDownBoldLeft: "\u2512",
112
- lineDownLeftBold: "\u2511",
113
- lineDownDoubleLeftDouble: "\u2557",
114
- lineDownDoubleLeft: "\u2556",
115
- lineDownLeftDouble: "\u2555",
116
- lineDownRight: "\u250C",
117
- lineDownRightArc: "\u256D",
118
- lineDownBoldRightBold: "\u250F",
119
- lineDownBoldRight: "\u250E",
120
- lineDownRightBold: "\u250D",
121
- lineDownDoubleRightDouble: "\u2554",
122
- lineDownDoubleRight: "\u2553",
123
- lineDownRightDouble: "\u2552",
124
- lineUpLeft: "\u2518",
125
- lineUpLeftArc: "\u256F",
126
- lineUpBoldLeftBold: "\u251B",
127
- lineUpBoldLeft: "\u251A",
128
- lineUpLeftBold: "\u2519",
129
- lineUpDoubleLeftDouble: "\u255D",
130
- lineUpDoubleLeft: "\u255C",
131
- lineUpLeftDouble: "\u255B",
132
- lineUpRight: "\u2514",
133
- lineUpRightArc: "\u2570",
134
- lineUpBoldRightBold: "\u2517",
135
- lineUpBoldRight: "\u2516",
136
- lineUpRightBold: "\u2515",
137
- lineUpDoubleRightDouble: "\u255A",
138
- lineUpDoubleRight: "\u2559",
139
- lineUpRightDouble: "\u2558",
140
- lineUpDownLeft: "\u2524",
141
- lineUpBoldDownBoldLeftBold: "\u252B",
142
- lineUpBoldDownBoldLeft: "\u2528",
143
- lineUpDownLeftBold: "\u2525",
144
- lineUpBoldDownLeftBold: "\u2529",
145
- lineUpDownBoldLeftBold: "\u252A",
146
- lineUpDownBoldLeft: "\u2527",
147
- lineUpBoldDownLeft: "\u2526",
148
- lineUpDoubleDownDoubleLeftDouble: "\u2563",
149
- lineUpDoubleDownDoubleLeft: "\u2562",
150
- lineUpDownLeftDouble: "\u2561",
151
- lineUpDownRight: "\u251C",
152
- lineUpBoldDownBoldRightBold: "\u2523",
153
- lineUpBoldDownBoldRight: "\u2520",
154
- lineUpDownRightBold: "\u251D",
155
- lineUpBoldDownRightBold: "\u2521",
156
- lineUpDownBoldRightBold: "\u2522",
157
- lineUpDownBoldRight: "\u251F",
158
- lineUpBoldDownRight: "\u251E",
159
- lineUpDoubleDownDoubleRightDouble: "\u2560",
160
- lineUpDoubleDownDoubleRight: "\u255F",
161
- lineUpDownRightDouble: "\u255E",
162
- lineDownLeftRight: "\u252C",
163
- lineDownBoldLeftBoldRightBold: "\u2533",
164
- lineDownLeftBoldRightBold: "\u252F",
165
- lineDownBoldLeftRight: "\u2530",
166
- lineDownBoldLeftBoldRight: "\u2531",
167
- lineDownBoldLeftRightBold: "\u2532",
168
- lineDownLeftRightBold: "\u252E",
169
- lineDownLeftBoldRight: "\u252D",
170
- lineDownDoubleLeftDoubleRightDouble: "\u2566",
171
- lineDownDoubleLeftRight: "\u2565",
172
- lineDownLeftDoubleRightDouble: "\u2564",
173
- lineUpLeftRight: "\u2534",
174
- lineUpBoldLeftBoldRightBold: "\u253B",
175
- lineUpLeftBoldRightBold: "\u2537",
176
- lineUpBoldLeftRight: "\u2538",
177
- lineUpBoldLeftBoldRight: "\u2539",
178
- lineUpBoldLeftRightBold: "\u253A",
179
- lineUpLeftRightBold: "\u2536",
180
- lineUpLeftBoldRight: "\u2535",
181
- lineUpDoubleLeftDoubleRightDouble: "\u2569",
182
- lineUpDoubleLeftRight: "\u2568",
183
- lineUpLeftDoubleRightDouble: "\u2567",
184
- lineUpDownLeftRight: "\u253C",
185
- lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
186
- lineUpDownBoldLeftBoldRightBold: "\u2548",
187
- lineUpBoldDownLeftBoldRightBold: "\u2547",
188
- lineUpBoldDownBoldLeftRightBold: "\u254A",
189
- lineUpBoldDownBoldLeftBoldRight: "\u2549",
190
- lineUpBoldDownLeftRight: "\u2540",
191
- lineUpDownBoldLeftRight: "\u2541",
192
- lineUpDownLeftBoldRight: "\u253D",
193
- lineUpDownLeftRightBold: "\u253E",
194
- lineUpBoldDownBoldLeftRight: "\u2542",
195
- lineUpDownLeftBoldRightBold: "\u253F",
196
- lineUpBoldDownLeftBoldRight: "\u2543",
197
- lineUpBoldDownLeftRightBold: "\u2544",
198
- lineUpDownBoldLeftBoldRight: "\u2545",
199
- lineUpDownBoldLeftRightBold: "\u2546",
200
- lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
201
- lineUpDoubleDownDoubleLeftRight: "\u256B",
202
- lineUpDownLeftDoubleRightDouble: "\u256A",
203
- lineCross: "\u2573",
204
- lineBackslash: "\u2572",
205
- lineSlash: "\u2571"
12
+ circleQuestionMark: '(?)',
13
+ questionMarkPrefix: '(?)',
14
+ square: '\u2588',
15
+ squareDarkShade: '\u2593',
16
+ squareMediumShade: '\u2592',
17
+ squareLightShade: '\u2591',
18
+ squareTop: '\u2580',
19
+ squareBottom: '\u2584',
20
+ squareLeft: '\u258C',
21
+ squareRight: '\u2590',
22
+ squareCenter: '\u25A0',
23
+ bullet: '\u25CF',
24
+ dot: '\u2024',
25
+ ellipsis: '\u2026',
26
+ pointerSmall: '\u203A',
27
+ triangleUp: '\u25B2',
28
+ triangleUpSmall: '\u25B4',
29
+ triangleDown: '\u25BC',
30
+ triangleDownSmall: '\u25BE',
31
+ triangleLeftSmall: '\u25C2',
32
+ triangleRightSmall: '\u25B8',
33
+ home: '\u2302',
34
+ heart: '\u2665',
35
+ musicNote: '\u266A',
36
+ musicNoteBeamed: '\u266B',
37
+ arrowUp: '\u2191',
38
+ arrowDown: '\u2193',
39
+ arrowLeft: '\u2190',
40
+ arrowRight: '\u2192',
41
+ arrowLeftRight: '\u2194',
42
+ arrowUpDown: '\u2195',
43
+ almostEqual: '\u2248',
44
+ notEqual: '\u2260',
45
+ lessOrEqual: '\u2264',
46
+ greaterOrEqual: '\u2265',
47
+ identical: '\u2261',
48
+ infinity: '\u221E',
49
+ subscriptZero: '\u2080',
50
+ subscriptOne: '\u2081',
51
+ subscriptTwo: '\u2082',
52
+ subscriptThree: '\u2083',
53
+ subscriptFour: '\u2084',
54
+ subscriptFive: '\u2085',
55
+ subscriptSix: '\u2086',
56
+ subscriptSeven: '\u2087',
57
+ subscriptEight: '\u2088',
58
+ subscriptNine: '\u2089',
59
+ oneHalf: '\xBD',
60
+ oneThird: '\u2153',
61
+ oneQuarter: '\xBC',
62
+ oneFifth: '\u2155',
63
+ oneSixth: '\u2159',
64
+ oneEighth: '\u215B',
65
+ twoThirds: '\u2154',
66
+ twoFifths: '\u2156',
67
+ threeQuarters: '\xBE',
68
+ threeFifths: '\u2157',
69
+ threeEighths: '\u215C',
70
+ fourFifths: '\u2158',
71
+ fiveSixths: '\u215A',
72
+ fiveEighths: '\u215D',
73
+ sevenEighths: '\u215E',
74
+ line: '\u2500',
75
+ lineBold: '\u2501',
76
+ lineDouble: '\u2550',
77
+ lineDashed0: '\u2504',
78
+ lineDashed1: '\u2505',
79
+ lineDashed2: '\u2508',
80
+ lineDashed3: '\u2509',
81
+ lineDashed4: '\u254C',
82
+ lineDashed5: '\u254D',
83
+ lineDashed6: '\u2574',
84
+ lineDashed7: '\u2576',
85
+ lineDashed8: '\u2578',
86
+ lineDashed9: '\u257A',
87
+ lineDashed10: '\u257C',
88
+ lineDashed11: '\u257E',
89
+ lineDashed12: '\u2212',
90
+ lineDashed13: '\u2013',
91
+ lineDashed14: '\u2010',
92
+ lineDashed15: '\u2043',
93
+ lineVertical: '\u2502',
94
+ lineVerticalBold: '\u2503',
95
+ lineVerticalDouble: '\u2551',
96
+ lineVerticalDashed0: '\u2506',
97
+ lineVerticalDashed1: '\u2507',
98
+ lineVerticalDashed2: '\u250A',
99
+ lineVerticalDashed3: '\u250B',
100
+ lineVerticalDashed4: '\u254E',
101
+ lineVerticalDashed5: '\u254F',
102
+ lineVerticalDashed6: '\u2575',
103
+ lineVerticalDashed7: '\u2577',
104
+ lineVerticalDashed8: '\u2579',
105
+ lineVerticalDashed9: '\u257B',
106
+ lineVerticalDashed10: '\u257D',
107
+ lineVerticalDashed11: '\u257F',
108
+ lineDownLeft: '\u2510',
109
+ lineDownLeftArc: '\u256E',
110
+ lineDownBoldLeftBold: '\u2513',
111
+ lineDownBoldLeft: '\u2512',
112
+ lineDownLeftBold: '\u2511',
113
+ lineDownDoubleLeftDouble: '\u2557',
114
+ lineDownDoubleLeft: '\u2556',
115
+ lineDownLeftDouble: '\u2555',
116
+ lineDownRight: '\u250C',
117
+ lineDownRightArc: '\u256D',
118
+ lineDownBoldRightBold: '\u250F',
119
+ lineDownBoldRight: '\u250E',
120
+ lineDownRightBold: '\u250D',
121
+ lineDownDoubleRightDouble: '\u2554',
122
+ lineDownDoubleRight: '\u2553',
123
+ lineDownRightDouble: '\u2552',
124
+ lineUpLeft: '\u2518',
125
+ lineUpLeftArc: '\u256F',
126
+ lineUpBoldLeftBold: '\u251B',
127
+ lineUpBoldLeft: '\u251A',
128
+ lineUpLeftBold: '\u2519',
129
+ lineUpDoubleLeftDouble: '\u255D',
130
+ lineUpDoubleLeft: '\u255C',
131
+ lineUpLeftDouble: '\u255B',
132
+ lineUpRight: '\u2514',
133
+ lineUpRightArc: '\u2570',
134
+ lineUpBoldRightBold: '\u2517',
135
+ lineUpBoldRight: '\u2516',
136
+ lineUpRightBold: '\u2515',
137
+ lineUpDoubleRightDouble: '\u255A',
138
+ lineUpDoubleRight: '\u2559',
139
+ lineUpRightDouble: '\u2558',
140
+ lineUpDownLeft: '\u2524',
141
+ lineUpBoldDownBoldLeftBold: '\u252B',
142
+ lineUpBoldDownBoldLeft: '\u2528',
143
+ lineUpDownLeftBold: '\u2525',
144
+ lineUpBoldDownLeftBold: '\u2529',
145
+ lineUpDownBoldLeftBold: '\u252A',
146
+ lineUpDownBoldLeft: '\u2527',
147
+ lineUpBoldDownLeft: '\u2526',
148
+ lineUpDoubleDownDoubleLeftDouble: '\u2563',
149
+ lineUpDoubleDownDoubleLeft: '\u2562',
150
+ lineUpDownLeftDouble: '\u2561',
151
+ lineUpDownRight: '\u251C',
152
+ lineUpBoldDownBoldRightBold: '\u2523',
153
+ lineUpBoldDownBoldRight: '\u2520',
154
+ lineUpDownRightBold: '\u251D',
155
+ lineUpBoldDownRightBold: '\u2521',
156
+ lineUpDownBoldRightBold: '\u2522',
157
+ lineUpDownBoldRight: '\u251F',
158
+ lineUpBoldDownRight: '\u251E',
159
+ lineUpDoubleDownDoubleRightDouble: '\u2560',
160
+ lineUpDoubleDownDoubleRight: '\u255F',
161
+ lineUpDownRightDouble: '\u255E',
162
+ lineDownLeftRight: '\u252C',
163
+ lineDownBoldLeftBoldRightBold: '\u2533',
164
+ lineDownLeftBoldRightBold: '\u252F',
165
+ lineDownBoldLeftRight: '\u2530',
166
+ lineDownBoldLeftBoldRight: '\u2531',
167
+ lineDownBoldLeftRightBold: '\u2532',
168
+ lineDownLeftRightBold: '\u252E',
169
+ lineDownLeftBoldRight: '\u252D',
170
+ lineDownDoubleLeftDoubleRightDouble: '\u2566',
171
+ lineDownDoubleLeftRight: '\u2565',
172
+ lineDownLeftDoubleRightDouble: '\u2564',
173
+ lineUpLeftRight: '\u2534',
174
+ lineUpBoldLeftBoldRightBold: '\u253B',
175
+ lineUpLeftBoldRightBold: '\u2537',
176
+ lineUpBoldLeftRight: '\u2538',
177
+ lineUpBoldLeftBoldRight: '\u2539',
178
+ lineUpBoldLeftRightBold: '\u253A',
179
+ lineUpLeftRightBold: '\u2536',
180
+ lineUpLeftBoldRight: '\u2535',
181
+ lineUpDoubleLeftDoubleRightDouble: '\u2569',
182
+ lineUpDoubleLeftRight: '\u2568',
183
+ lineUpLeftDoubleRightDouble: '\u2567',
184
+ lineUpDownLeftRight: '\u253C',
185
+ lineUpBoldDownBoldLeftBoldRightBold: '\u254B',
186
+ lineUpDownBoldLeftBoldRightBold: '\u2548',
187
+ lineUpBoldDownLeftBoldRightBold: '\u2547',
188
+ lineUpBoldDownBoldLeftRightBold: '\u254A',
189
+ lineUpBoldDownBoldLeftBoldRight: '\u2549',
190
+ lineUpBoldDownLeftRight: '\u2540',
191
+ lineUpDownBoldLeftRight: '\u2541',
192
+ lineUpDownLeftBoldRight: '\u253D',
193
+ lineUpDownLeftRightBold: '\u253E',
194
+ lineUpBoldDownBoldLeftRight: '\u2542',
195
+ lineUpDownLeftBoldRightBold: '\u253F',
196
+ lineUpBoldDownLeftBoldRight: '\u2543',
197
+ lineUpBoldDownLeftRightBold: '\u2544',
198
+ lineUpDownBoldLeftBoldRight: '\u2545',
199
+ lineUpDownBoldLeftRightBold: '\u2546',
200
+ lineUpDoubleDownDoubleLeftDoubleRightDouble: '\u256C',
201
+ lineUpDoubleDownDoubleLeftRight: '\u256B',
202
+ lineUpDownLeftDoubleRightDouble: '\u256A',
203
+ lineCross: '\u2573',
204
+ lineBackslash: '\u2572',
205
+ lineSlash: '\u2571',
206
206
  };
207
+
207
208
  const specialMainSymbols = {
208
- tick: "\u2714",
209
- info: "\u2139",
210
- warning: "\u26A0",
211
- cross: "\u2718",
212
- squareSmall: "\u25FB",
213
- squareSmallFilled: "\u25FC",
214
- circle: "\u25EF",
215
- circleFilled: "\u25C9",
216
- circleDotted: "\u25CC",
217
- circleDouble: "\u25CE",
218
- circleCircle: "\u24DE",
219
- circleCross: "\u24E7",
220
- circlePipe: "\u24BE",
221
- radioOn: "\u25C9",
222
- radioOff: "\u25EF",
223
- checkboxOn: "\u2612",
224
- checkboxOff: "\u2610",
225
- checkboxCircleOn: "\u24E7",
226
- checkboxCircleOff: "\u24BE",
227
- pointer: "\u276F",
228
- triangleUpOutline: "\u25B3",
229
- triangleLeft: "\u25C0",
230
- triangleRight: "\u25B6",
231
- lozenge: "\u25C6",
232
- lozengeOutline: "\u25C7",
233
- hamburger: "\u2630",
234
- smiley: "\u32E1",
235
- mustache: "\u0DF4",
236
- star: "\u2605",
237
- play: "\u25B6",
238
- nodejs: "\u2B22",
239
- oneSeventh: "\u2150",
240
- oneNinth: "\u2151",
241
- oneTenth: "\u2152"
209
+ tick: '\u2714',
210
+ info: '\u2139',
211
+ warning: '\u26A0',
212
+ cross: '\u2718',
213
+ squareSmall: '\u25FB',
214
+ squareSmallFilled: '\u25FC',
215
+ circle: '\u25EF',
216
+ circleFilled: '\u25C9',
217
+ circleDotted: '\u25CC',
218
+ circleDouble: '\u25CE',
219
+ circleCircle: '\u24DE',
220
+ circleCross: '\u24E7',
221
+ circlePipe: '\u24BE',
222
+ radioOn: '\u25C9',
223
+ radioOff: '\u25EF',
224
+ checkboxOn: '\u2612',
225
+ checkboxOff: '\u2610',
226
+ checkboxCircleOn: '\u24E7',
227
+ checkboxCircleOff: '\u24BE',
228
+ pointer: '\u276F',
229
+ triangleUpOutline: '\u25B3',
230
+ triangleLeft: '\u25C0',
231
+ triangleRight: '\u25B6',
232
+ lozenge: '\u25C6',
233
+ lozengeOutline: '\u25C7',
234
+ hamburger: '\u2630',
235
+ smiley: '\u32E1',
236
+ mustache: '\u0DF4',
237
+ star: '\u2605',
238
+ play: '\u25B6',
239
+ nodejs: '\u2B22',
240
+ oneSeventh: '\u2150',
241
+ oneNinth: '\u2151',
242
+ oneTenth: '\u2152',
242
243
  };
244
+
243
245
  const specialFallbackSymbols = {
244
- tick: "\u221A",
245
- info: "i",
246
- warning: "\u203C",
247
- cross: "\xD7",
248
- squareSmall: "\u25A1",
249
- squareSmallFilled: "\u25A0",
250
- circle: "( )",
251
- circleFilled: "(*)",
252
- circleDotted: "( )",
253
- circleDouble: "( )",
254
- circleCircle: "(\u25CB)",
255
- circleCross: "(\xD7)",
256
- circlePipe: "(\u2502)",
257
- radioOn: "(*)",
258
- radioOff: "( )",
259
- checkboxOn: "[\xD7]",
260
- checkboxOff: "[ ]",
261
- checkboxCircleOn: "(\xD7)",
262
- checkboxCircleOff: "( )",
263
- pointer: ">",
264
- triangleUpOutline: "\u2206",
265
- triangleLeft: "\u25C4",
266
- triangleRight: "\u25BA",
267
- lozenge: "\u2666",
268
- lozengeOutline: "\u25CA",
269
- hamburger: "\u2261",
270
- smiley: "\u263A",
271
- mustache: "\u250C\u2500\u2510",
272
- star: "\u2736",
273
- play: "\u25BA",
274
- nodejs: "\u2666",
275
- oneSeventh: "1/7",
276
- oneNinth: "1/9",
277
- oneTenth: "1/10"
246
+ tick: '\u221A',
247
+ info: 'i',
248
+ warning: '\u203C',
249
+ cross: '\xD7',
250
+ squareSmall: '\u25A1',
251
+ squareSmallFilled: '\u25A0',
252
+ circle: '( )',
253
+ circleFilled: '(*)',
254
+ circleDotted: '( )',
255
+ circleDouble: '( )',
256
+ circleCircle: '(\u25CB)',
257
+ circleCross: '(\xD7)',
258
+ circlePipe: '(\u2502)',
259
+ radioOn: '(*)',
260
+ radioOff: '( )',
261
+ checkboxOn: '[\xD7]',
262
+ checkboxOff: '[ ]',
263
+ checkboxCircleOn: '(\xD7)',
264
+ checkboxCircleOff: '( )',
265
+ pointer: '>',
266
+ triangleUpOutline: '\u2206',
267
+ triangleLeft: '\u25C4',
268
+ triangleRight: '\u25BA',
269
+ lozenge: '\u2666',
270
+ lozengeOutline: '\u25CA',
271
+ hamburger: '\u2261',
272
+ smiley: '\u263A',
273
+ mustache: '\u250C\u2500\u2510',
274
+ star: '\u2736',
275
+ play: '\u25BA',
276
+ nodejs: '\u2666',
277
+ oneSeventh: '1/7',
278
+ oneNinth: '1/9',
279
+ oneTenth: '1/10',
280
+ };
281
+
282
+ export const mainSymbols = { ...common,
283
+ ...specialMainSymbols,
278
284
  };
279
- export const mainSymbols = { ...common, ...specialMainSymbols };
280
285
  export const fallbackSymbols = {
281
- ...common,
282
- ...specialFallbackSymbols
286
+ ...common,
287
+ ...specialFallbackSymbols,
283
288
  };
284
289
  const shouldUseMain = isUnicodeSupported();
285
290
  const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
291
+
286
292
  export default figures;
293
+
287
294
  const replacements = Object.entries(specialMainSymbols);
288
- export const replaceSymbols = (string, { useFallback = !shouldUseMain } = {}) => {
289
- if (useFallback) {
290
- for (const [key, mainSymbol] of replacements) {
291
- const fallbackSymbol = fallbackSymbols[key];
292
- if (!fallbackSymbol) {
293
- throw new Error(`Unable to find fallback for ${key}`);
294
- }
295
- string = string.replaceAll(mainSymbol, fallbackSymbol);
295
+
296
+ export const replaceSymbols = (string, {useFallback = !shouldUseMain} = {}) => {
297
+ if (useFallback) {
298
+ for (const [key, mainSymbol] of replacements) {
299
+ const fallbackSymbol = fallbackSymbols[key];
300
+
301
+ if (!fallbackSymbol) {
302
+ throw Error(`Unable to find fallback for ${key}`);
303
+ }
304
+
305
+ string = string.replaceAll(mainSymbol, fallbackSymbol);
306
+ }
296
307
  }
297
- }
298
- return string;
308
+
309
+ return string;
299
310
  };