@shell-shock/plugin-console 0.1.8 → 0.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,10 @@ declare function AnsiHelpersDeclarations(): Children;
9
9
  * A component to generate an object containing functions for coloring text in a Shell Shock project.
10
10
  */
11
11
  declare function ColorsDeclaration(): Children;
12
+ /**
13
+ * A component to generate the `splitText` function in the `shell-shock:console` builtin module.
14
+ */
15
+ declare function SplitTextFunctionDeclaration(): Children;
12
16
  /**
13
17
  * A component to generate the `writeLine` function in the `shell-shock:console` builtin module.
14
18
  */
@@ -60,5 +64,5 @@ type ConsoleBuiltinProps = Pick<BuiltinFileProps, "children" | "imports" | "buil
60
64
  */
61
65
  declare function ConsoleBuiltin(props: ConsoleBuiltinProps): Children;
62
66
  //#endregion
63
- export { AnsiHelpersDeclarations, ColorsDeclaration, ConsoleBuiltin, ConsoleBuiltinProps, DividerFunctionDeclaration, LinkFunctionDeclaration, MessageFunctionDeclaration, MessageFunctionDeclarationProps, SpinnerFunctionDeclaration, StripAnsiFunctionDeclaration, TableFunctionDeclaration, TableFunctionDeclarationProps, WrapAnsiFunction, WriteLineFunctionDeclaration };
67
+ export { AnsiHelpersDeclarations, ColorsDeclaration, ConsoleBuiltin, ConsoleBuiltinProps, DividerFunctionDeclaration, LinkFunctionDeclaration, MessageFunctionDeclaration, MessageFunctionDeclarationProps, SpinnerFunctionDeclaration, SplitTextFunctionDeclaration, StripAnsiFunctionDeclaration, TableFunctionDeclaration, TableFunctionDeclarationProps, WrapAnsiFunction, WriteLineFunctionDeclaration };
64
68
  //# sourceMappingURL=console-builtin.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"console-builtin.d.cts","names":[],"sources":["../../src/components/console-builtin.tsx"],"sourcesContent":[],"mappings":";;;;;;iBA+DgB,uBAAA,CAAA,GAAuB;;AAAvC;AA6JA;AAqqDgB,iBArqDA,iBAAA,CAAA,CAqqD4B,EArqDX,Q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EASA,OAAA,EAAS,mBAAA;EACT,KAAA,GAAQ,mBAAA;EACR,aAAA;EACA,WAAA;EACA,MAAA,GAAS,QAAA;EACT,SAAA;AAAA;AAjBF;;;AAAA,iBAuBgB,0BAAA,CACd,KAAA,EAAO,+BAAA,GAA+B,QAAA;;;;iBA0KxB,gBAAA,CAAA,GAAgB,QAAA;;;;iBA4EhB,4BAAA,CAAA,GAA4B,QAAA;;;;iBAmC5B,0BAAA,CAAA,GAA0B,QAAA;;;;iBAoF1B,uBAAA,CAAA,GAAuB,QAAA;;;;iBAwCvB,0BAAA,CAAA,GAA0B,QAAA;;;AAtZ1C;KAg7BY,6BAAA,GAAgC,IAAA,CAC1C,wBAAA;;;;iBAOc,wBAAA,CAAyB,KAAA,EAAO,6BAAA,GAA6B,QAAA;AAAA,KA0nBjE,mBAAA,GAAsB,IAAA,CAChC,gBAAA;;;AAx4CF;iBA+4CgB,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,QAAA"}
@@ -9,6 +9,10 @@ declare function AnsiHelpersDeclarations(): Children;
9
9
  * A component to generate an object containing functions for coloring text in a Shell Shock project.
10
10
  */
11
11
  declare function ColorsDeclaration(): Children;
12
+ /**
13
+ * A component to generate the `splitText` function in the `shell-shock:console` builtin module.
14
+ */
15
+ declare function SplitTextFunctionDeclaration(): Children;
12
16
  /**
13
17
  * A component to generate the `writeLine` function in the `shell-shock:console` builtin module.
14
18
  */
@@ -60,5 +64,5 @@ type ConsoleBuiltinProps = Pick<BuiltinFileProps, "children" | "imports" | "buil
60
64
  */
61
65
  declare function ConsoleBuiltin(props: ConsoleBuiltinProps): Children;
62
66
  //#endregion
63
- export { AnsiHelpersDeclarations, ColorsDeclaration, ConsoleBuiltin, ConsoleBuiltinProps, DividerFunctionDeclaration, LinkFunctionDeclaration, MessageFunctionDeclaration, MessageFunctionDeclarationProps, SpinnerFunctionDeclaration, StripAnsiFunctionDeclaration, TableFunctionDeclaration, TableFunctionDeclarationProps, WrapAnsiFunction, WriteLineFunctionDeclaration };
67
+ export { AnsiHelpersDeclarations, ColorsDeclaration, ConsoleBuiltin, ConsoleBuiltinProps, DividerFunctionDeclaration, LinkFunctionDeclaration, MessageFunctionDeclaration, MessageFunctionDeclarationProps, SpinnerFunctionDeclaration, SplitTextFunctionDeclaration, StripAnsiFunctionDeclaration, TableFunctionDeclaration, TableFunctionDeclarationProps, WrapAnsiFunction, WriteLineFunctionDeclaration };
64
68
  //# sourceMappingURL=console-builtin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"console-builtin.d.mts","names":[],"sources":["../../src/components/console-builtin.tsx"],"sourcesContent":[],"mappings":";;;;;;iBA+DgB,uBAAA,CAAA,GAAuB;;AAAvC;AA6JA;AAqqDgB,iBArqDA,iBAAA,CAAA,CAqqD4B,EArqDX,QAqqDW;AA8P5C;;;AAA8C,iBA9P9B,4BAAA,CAAA,CA8P8B,EA9PF,QA8PE;AAYnC,KAZC,+BAAA,GAAkC,OAYnC,CAXT,IAWS,CAXJ,wBAWI,EAAA,YAAA,CAAA,CAAA,GAAA;EACD,IAAA,EAAA,SAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,SAAA,GAAA,MAAA,GAAA,QAAA,GAAA,OAAA;EAGC,OAAA,EAJA,mBAIA;EAAQ,KAAA,CAAA,EAHT,mBAGS;EAOH,aAAA,EAAA,KAAA,GAAA,MAA0B,GAAA,MAAA,GACjC,OAAA,GAAA,OAAA;EA2KO,WAAA,EAAA,MAAgB;EA4EhB,MAAA,CAAA,EA/PL,QA+PK;EAmCA,SAAA,CAAA,EAAA,OAAA;AAoFhB,CAAA;AAwCA;AA0hBA;AAQA;AA4nBY,iBArjDI,0BAAA,CAsjDd,KADgC,EApjDzB,+BAojD6B,CAAA,EApjDE,QAojDF;AAQtC;;;iBAj5CgB,gBAAA,CAAA,GAAgB;;;;iBA4EhB,4BAAA,CAAA,GAA4B;;;;iBAmC5B,0BAAA,CAAA,GAA0B;;;;iBAoF1B,uBAAA,CAAA,GAAuB;;;;iBAwCvB,0BAAA,CAAA,GAA0B;;;;KA0hB9B,6BAAA,GAAgC,KAC1C;;;;iBAOc,wBAAA,QAAgC,gCAA6B;KA4nBjE,mBAAA,GAAsB,KAChC;;;;iBAOc,cAAA,QAAsB,sBAAmB"}
1
+ {"version":3,"file":"console-builtin.d.mts","names":[],"sources":["../../src/components/console-builtin.tsx"],"mappings":";;;;;;iBA+DgB,uBAAA,CAAA,GAAuB,QAAA;;AAAvC;;iBA6JgB,iBAAA,CAAA,GAAiB,QAAA;;;AAAjC;iBAqqDgB,4BAAA,CAAA,GAA4B,QAAA;;;;iBAiL5B,4BAAA,CAAA,GAA4B,QAAA;AAAA,KAsFhC,+BAAA,GAAkC,OAAA,CAC5C,IAAA,CAAK,wBAAA;EAEL,IAAA;EASA,OAAA,EAAS,mBAAA;EACT,KAAA,GAAQ,mBAAA;EACR,aAAA;EACA,WAAA;EACA,MAAA,GAAS,QAAA;EACT,SAAA;AAAA;AAjBF;;;AAAA,iBAuBgB,0BAAA,CACd,KAAA,EAAO,+BAAA,GAA+B,QAAA;;;;iBA0KxB,gBAAA,CAAA,GAAgB,QAAA;;;;iBA4EhB,4BAAA,CAAA,GAA4B,QAAA;;;;iBAmC5B,0BAAA,CAAA,GAA0B,QAAA;;;;iBAoF1B,uBAAA,CAAA,GAAuB,QAAA;;;;iBAwCvB,0BAAA,CAAA,GAA0B,QAAA;;;AAtZ1C;KAg7BY,6BAAA,GAAgC,IAAA,CAC1C,wBAAA;;;;iBAOc,wBAAA,CAAyB,KAAA,EAAO,6BAAA,GAA6B,QAAA;AAAA,KA0nBjE,mBAAA,GAAsB,IAAA,CAChC,gBAAA;;;AAx4CF;iBA+4CgB,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,QAAA"}
@@ -78,7 +78,7 @@ function AnsiHelpersDeclarations() {
78
78
  line: "\\x1B[2K",
79
79
  lineEnd: "\\x1B[K",
80
80
  lineStart: "\\x1B[1K",
81
- lines(count) {
81
+ lines(count: number) {
82
82
  let lineClear = "";
83
83
  for (let i = 0; i < count; i++) {
84
84
  lineClear += this.line + (i < count - 1 ? cursor.up() : "");
@@ -1663,10 +1663,9 @@ function ColorsDeclaration() {
1663
1663
  ];
1664
1664
  }
1665
1665
  /**
1666
- * A component to generate the `writeLine` function in the `shell-shock:console` builtin module.
1666
+ * A component to generate the `splitText` function in the `shell-shock:console` builtin module.
1667
1667
  */
1668
- function WriteLineFunctionDeclaration() {
1669
- const theme = useTheme();
1668
+ function SplitTextFunctionDeclaration() {
1670
1669
  return [
1671
1670
  createComponent(FunctionDeclaration, {
1672
1671
  name: "adjustIndex",
@@ -1830,8 +1829,15 @@ function WriteLineFunctionDeclaration() {
1830
1829
  result.push(line);
1831
1830
  return result;
1832
1831
  `
1833
- }),
1834
- createComponent(Spacing, {}),
1832
+ })
1833
+ ];
1834
+ }
1835
+ /**
1836
+ * A component to generate the `writeLine` function in the `shell-shock:console` builtin module.
1837
+ */
1838
+ function WriteLineFunctionDeclaration() {
1839
+ const theme = useTheme();
1840
+ return [
1835
1841
  createComponent(InterfaceDeclaration, {
1836
1842
  "export": true,
1837
1843
  name: "WriteLineOptions",
@@ -1976,7 +1982,6 @@ function MessageFunctionDeclaration(props) {
1976
1982
 
1977
1983
  ${!theme.labels.message.footer[variant] && timestamp ? `const timestamp = \`\${colors.text.message.footer.${color}(new Date().toLocaleDateString())} \${colors.border.message.outline.${color}("${theme.borderStyles.message.outline[variant].bottom}")} \${colors.text.message.footer.${color}(new Date().toLocaleTimeString())}\`; ` : ""}
1978
1984
 
1979
- writeLine("");
1980
1985
  writeLine(colors.border.message.outline.${color}("${theme.borderStyles.message.outline[variant].topLeft}") + ${theme.labels.message.header[variant] || theme.icons.message.header[variant] ? `colors.border.message.outline.${color}("${theme.borderStyles.message.outline[variant].top}".repeat(4)) + " " + ${theme.icons.message.header[variant] ? `colors.border.message.outline.${color}("${theme.icons.message.header[variant]}") + " " +` : ""} colors.bold(colors.text.message.header.${color}("${theme.labels.message.header[variant]}")) + " " + colors.border.message.outline.${color}("${theme.borderStyles.message.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.message.outline[variant].topLeft.length + 4 + (theme.icons.message.header[variant] ? 2 + (theme.labels.message.header[variant] ? 0 : 1) : 0) + (theme.labels.message.header[variant] ? theme.labels.message.header[variant].length + 2 : 0) + theme.borderStyles.message.outline[variant].topRight.length}, 0)))` : `colors.border.message.outline.${color}("${theme.borderStyles.message.outline[variant].top}".repeat(Math.max(process.stdout.columns - ${Math.max(theme.padding.app, 0) * 2 + theme.borderStyles.message.outline[variant].topLeft.length + theme.borderStyles.message.outline[variant].topRight.length}, 0)))`} + colors.border.message.outline.${color}("${theme.borderStyles.message.outline[variant].topRight}"), { consoleFn: console.${consoleFnName} });
1981
1986
  splitText(
1982
1987
  message,
@@ -2793,9 +2798,6 @@ function extractBorderOptionsString(direction, theme) {
2793
2798
  return `borderOptions === "primary" ? colors.border.app.table.primary("${theme.borderStyles.app.table.primary[direction]}") : borderOptions === "secondary" ? colors.border.app.table.secondary("${theme.borderStyles.app.table.secondary[direction]}") : borderOptions === "tertiary" ? colors.border.app.table.tertiary("${theme.borderStyles.app.table.tertiary[direction]}") : !borderOptions || borderOptions === "none" ? "" : borderOptions`;
2794
2799
  }
2795
2800
  /**
2796
- * Props for the TableFunctionDeclaration component.
2797
- */
2798
- /**
2799
2801
  * A component to generate the table functions in the `shell-shock:console` builtin module.
2800
2802
  */
2801
2803
  function TableFunctionDeclaration(props) {
@@ -2902,8 +2904,7 @@ function TableFunctionDeclaration(props) {
2902
2904
 
2903
2905
  throw new Error(\`Invalid width size: \${size}\`);
2904
2906
  ` }),
2905
- createIntrinsic("hbr", {}),
2906
- createIntrinsic("hbr", {})
2907
+ createComponent(Spacing, {})
2907
2908
  ];
2908
2909
  }
2909
2910
  }),
@@ -3164,8 +3165,7 @@ function TableFunctionDeclaration(props) {
3164
3165
  (Array.isArray(options) && !options.every(item => typeof item === "object" || typeof item === "string" || Array.isArray(item))) `,
3165
3166
  children: code`return;`
3166
3167
  }),
3167
- createIntrinsic("hbr", {}),
3168
- createIntrinsic("hbr", {}),
3168
+ createComponent(Spacing, {}),
3169
3169
  createComponent(VarDeclaration, {
3170
3170
  "let": true,
3171
3171
  name: "cells",
@@ -3532,6 +3532,8 @@ function ConsoleBuiltin(props) {
3532
3532
  createComponent(Spacing, {}),
3533
3533
  createComponent(WriteLineFunctionDeclaration, {}),
3534
3534
  createComponent(Spacing, {}),
3535
+ createComponent(SplitTextFunctionDeclaration, {}),
3536
+ createComponent(Spacing, {}),
3535
3537
  createComponent(LinkFunctionDeclaration, {}),
3536
3538
  createComponent(Spacing, {}),
3537
3539
  createComponent(DividerFunctionDeclaration, {}),
@@ -3654,5 +3656,5 @@ function ConsoleBuiltin(props) {
3654
3656
  }
3655
3657
 
3656
3658
  //#endregion
3657
- export { AnsiHelpersDeclarations, ColorsDeclaration, ConsoleBuiltin, DividerFunctionDeclaration, LinkFunctionDeclaration, MessageFunctionDeclaration, SpinnerFunctionDeclaration, StripAnsiFunctionDeclaration, TableFunctionDeclaration, WrapAnsiFunction, WriteLineFunctionDeclaration };
3659
+ export { AnsiHelpersDeclarations, ColorsDeclaration, ConsoleBuiltin, DividerFunctionDeclaration, LinkFunctionDeclaration, MessageFunctionDeclaration, SpinnerFunctionDeclaration, SplitTextFunctionDeclaration, StripAnsiFunctionDeclaration, TableFunctionDeclaration, WrapAnsiFunction, WriteLineFunctionDeclaration };
3658
3660
  //# sourceMappingURL=console-builtin.mjs.map