@rotorsoft/act-diagram 1.0.8 → 1.0.9

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/dist/cli/act.js CHANGED
@@ -2142,7 +2142,7 @@ function format_markdown(idx) {
2142
2142
  import { writeFile } from "fs/promises";
2143
2143
  import { resolve as resolve3 } from "path";
2144
2144
 
2145
- // ../../node_modules/.pnpm/@clack+core@1.4.1/node_modules/@clack/core/dist/index.mjs
2145
+ // ../../node_modules/.pnpm/@clack+core@1.4.2/node_modules/@clack/core/dist/index.mjs
2146
2146
  import { styleText } from "util";
2147
2147
  import { stdout, stdin } from "process";
2148
2148
  import * as l from "readline";
@@ -2484,7 +2484,7 @@ function wrapAnsi(string, columns, options) {
2484
2484
  return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
2485
2485
  }
2486
2486
 
2487
- // ../../node_modules/.pnpm/@clack+core@1.4.1/node_modules/@clack/core/dist/index.mjs
2487
+ // ../../node_modules/.pnpm/@clack+core@1.4.2/node_modules/@clack/core/dist/index.mjs
2488
2488
  var import_sisteransi = __toESM(require_src(), 1);
2489
2489
  import { ReadStream } from "tty";
2490
2490
  function findCursor(s, o2, l2) {
@@ -2809,7 +2809,7 @@ var n = class extends V {
2809
2809
  }
2810
2810
  };
2811
2811
 
2812
- // ../../node_modules/.pnpm/@clack+prompts@1.5.1/node_modules/@clack/prompts/dist/index.mjs
2812
+ // ../../node_modules/.pnpm/@clack+prompts@1.6.0/node_modules/@clack/prompts/dist/index.mjs
2813
2813
  import { styleText as styleText2, stripVTControlCharacters } from "util";
2814
2814
  import process$1 from "process";
2815
2815
  var import_sisteransi2 = __toESM(require_src(), 1);
@@ -2822,7 +2822,7 @@ function isUnicodeSupported() {
2822
2822
  return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
2823
2823
  }
2824
2824
  var unicode = isUnicodeSupported();
2825
- var unicodeOr = (e, o2) => unicode ? e : o2;
2825
+ var unicodeOr = (o2, e) => unicode ? o2 : e;
2826
2826
  var S_STEP_ACTIVE = unicodeOr("\u25C6", "*");
2827
2827
  var S_STEP_CANCEL = unicodeOr("\u25A0", "x");
2828
2828
  var S_STEP_ERROR = unicodeOr("\u25B2", "x");
@@ -2848,8 +2848,8 @@ var S_INFO = unicodeOr("\u25CF", "\u2022");
2848
2848
  var S_SUCCESS = unicodeOr("\u25C6", "*");
2849
2849
  var S_WARN = unicodeOr("\u25B2", "!");
2850
2850
  var S_ERROR = unicodeOr("\u25A0", "x");
2851
- var symbol = (e) => {
2852
- switch (e) {
2851
+ var symbol = (o2) => {
2852
+ switch (o2) {
2853
2853
  case "initial":
2854
2854
  case "active":
2855
2855
  return styleText2("cyan", S_STEP_ACTIVE);
@@ -2861,8 +2861,8 @@ var symbol = (e) => {
2861
2861
  return styleText2("green", S_STEP_SUBMIT);
2862
2862
  }
2863
2863
  };
2864
- var symbolBar = (e) => {
2865
- switch (e) {
2864
+ var symbolBar = (o2) => {
2865
+ switch (o2) {
2866
2866
  case "initial":
2867
2867
  case "active":
2868
2868
  return styleText2("cyan", S_BAR);
@@ -2874,6 +2874,10 @@ var symbolBar = (e) => {
2874
2874
  return styleText2("green", S_BAR);
2875
2875
  }
2876
2876
  };
2877
+ function formatInstructionFooter(o2, e) {
2878
+ const r2 = [`${e ? `${styleText2("cyan", S_BAR)} ` : ""}${o2.join(" \u2022 ")}`];
2879
+ return e && r2.push(styleText2("cyan", S_BAR_END)), r2;
2880
+ }
2877
2881
  var E$1 = (l2, o2, g, c2, h2, O = false) => {
2878
2882
  let r2 = o2, w = 0;
2879
2883
  if (O)
@@ -2936,6 +2940,11 @@ var limitOptions = ({
2936
2940
  b.push(n2);
2937
2941
  return u3 && b.push(C), b;
2938
2942
  };
2943
+ var MULTISELECT_INSTRUCTIONS = [
2944
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
2945
+ `${styleText2("dim", "Space:")} select`,
2946
+ `${styleText2("dim", "Enter:")} confirm`
2947
+ ];
2939
2948
  var log = {
2940
2949
  message: (s = [], {
2941
2950
  symbol: e = styleText2("gray", S_BAR),
@@ -2996,20 +3005,24 @@ var u2 = {
2996
3005
  heavy: unicodeOr("\u2501", "="),
2997
3006
  block: unicodeOr("\u2588", "#")
2998
3007
  };
2999
- var c = (e, a2) => e.includes(`
3000
- `) ? e.split(`
3001
- `).map((t2) => a2(t2)).join(`
3002
- `) : a2(e);
3003
- var select = (e) => {
3004
- const a2 = (t2, d) => {
3005
- const s = t2.label ?? String(t2.value);
3006
- switch (d) {
3008
+ var SELECT_INSTRUCTIONS = [
3009
+ `${styleText2("dim", "\u2191/\u2193")} to navigate`,
3010
+ `${styleText2("dim", "Enter:")} confirm`
3011
+ ];
3012
+ var c = (t2, a2) => t2.includes(`
3013
+ `) ? t2.split(`
3014
+ `).map((i2) => a2(i2)).join(`
3015
+ `) : a2(t2);
3016
+ var select = (t2) => {
3017
+ const a2 = (i2, m) => {
3018
+ const s = i2.label ?? String(i2.value);
3019
+ switch (m) {
3007
3020
  case "disabled":
3008
- return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (n2) => styleText2("gray", n2))}${t2.hint ? ` ${styleText2("dim", `(${t2.hint ?? "disabled"})`)}` : ""}`;
3021
+ return `${styleText2("gray", S_RADIO_INACTIVE)} ${c(s, (n2) => styleText2("gray", n2))}${i2.hint ? ` ${styleText2("dim", `(${i2.hint ?? "disabled"})`)}` : ""}`;
3009
3022
  case "selected":
3010
3023
  return `${c(s, (n2) => styleText2("dim", n2))}`;
3011
3024
  case "active":
3012
- return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${t2.hint ? ` ${styleText2("dim", `(${t2.hint})`)}` : ""}`;
3025
+ return `${styleText2("green", S_RADIO_ACTIVE)} ${s}${i2.hint ? ` ${styleText2("dim", `(${i2.hint})`)}` : ""}`;
3013
3026
  case "cancelled":
3014
3027
  return `${c(s, (n2) => styleText2(["strikethrough", "dim"], n2))}`;
3015
3028
  default:
@@ -3017,52 +3030,53 @@ var select = (e) => {
3017
3030
  }
3018
3031
  };
3019
3032
  return new a({
3020
- options: e.options,
3021
- signal: e.signal,
3022
- input: e.input,
3023
- output: e.output,
3024
- initialValue: e.initialValue,
3033
+ options: t2.options,
3034
+ signal: t2.signal,
3035
+ input: t2.input,
3036
+ output: t2.output,
3037
+ initialValue: t2.initialValue,
3025
3038
  render() {
3026
- const t2 = e.withGuide ?? settings.withGuide, d = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, n2 = wrapTextWithPrefix(
3027
- e.output,
3028
- e.message,
3039
+ const i2 = t2.withGuide ?? settings.withGuide, m = `${symbol(this.state)} `, s = `${symbolBar(this.state)} `, n2 = wrapTextWithPrefix(
3040
+ t2.output,
3041
+ t2.message,
3029
3042
  s,
3030
- d
3031
- ), u3 = `${t2 ? `${styleText2("gray", S_BAR)}
3043
+ m
3044
+ ), u3 = `${i2 ? `${styleText2("gray", S_BAR)}
3032
3045
  ` : ""}${n2}
3033
3046
  `;
3034
3047
  switch (this.state) {
3035
3048
  case "submit": {
3036
- const r2 = t2 ? `${styleText2("gray", S_BAR)} ` : "", l2 = wrapTextWithPrefix(
3037
- e.output,
3049
+ const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", o2 = wrapTextWithPrefix(
3050
+ t2.output,
3038
3051
  a2(this.options[this.cursor], "selected"),
3039
3052
  r2
3040
3053
  );
3041
- return `${u3}${l2}`;
3054
+ return `${u3}${o2}`;
3042
3055
  }
3043
3056
  case "cancel": {
3044
- const r2 = t2 ? `${styleText2("gray", S_BAR)} ` : "", l2 = wrapTextWithPrefix(
3045
- e.output,
3057
+ const r2 = i2 ? `${styleText2("gray", S_BAR)} ` : "", o2 = wrapTextWithPrefix(
3058
+ t2.output,
3046
3059
  a2(this.options[this.cursor], "cancelled"),
3047
3060
  r2
3048
3061
  );
3049
- return `${u3}${l2}${t2 ? `
3062
+ return `${u3}${o2}${i2 ? `
3050
3063
  ${styleText2("gray", S_BAR)}` : ""}`;
3051
3064
  }
3052
3065
  default: {
3053
- const r2 = t2 ? `${styleText2("cyan", S_BAR)} ` : "", l2 = t2 ? styleText2("cyan", S_BAR_END) : "", g = u3.split(`
3054
- `).length, h2 = t2 ? 2 : 1;
3066
+ const r2 = i2 ? `${styleText2("cyan", S_BAR)} ` : "", o2 = u3.split(`
3067
+ `).length, $ = formatInstructionFooter(SELECT_INSTRUCTIONS, i2), h2 = $.join(`
3068
+ `), b = $.length + 1;
3055
3069
  return `${u3}${r2}${limitOptions({
3056
- output: e.output,
3070
+ output: t2.output,
3057
3071
  cursor: this.cursor,
3058
3072
  options: this.options,
3059
- maxItems: e.maxItems,
3073
+ maxItems: t2.maxItems,
3060
3074
  columnPadding: r2.length,
3061
- rowPadding: g + h2,
3062
- style: (p, b) => a2(p, p.disabled ? "disabled" : b ? "active" : "inactive")
3075
+ rowPadding: o2 + b,
3076
+ style: (p, x) => a2(p, p.disabled ? "disabled" : x ? "active" : "inactive")
3063
3077
  }).join(`
3064
3078
  ${r2}`)}
3065
- ${l2}
3079
+ ${h2}
3066
3080
  `;
3067
3081
  }
3068
3082
  }